Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: Temps
  • Order by date
  1. Temps

    Creating child processes in c for windows ---------------

    Not sure why you want to do all this by spawning child processes. Why don't you make the program multi-threaded and do what you require on different threads? You can get each thread to write a number to a 'queue' (STL will give you the code needed) and the main thread can then loop and read...
  2. Temps

    Using Run-Time Dynamic Linking

    I don't think it's a problem with the typedef definition - it would give a different error. The error message means that GetProcAddress cannot find the function name you're passing in - check the dll's exported functions to ensure you've got the right function name.
  3. Temps

    float something[1000][1000]?

    Same applies for any dynamically allocated multi-dimensional array. So for a 1000*1000 char array:- char (*something)[1000]; something = new char[1000][1000]; something[34][24] = 'z'; printf("Output: %c\n\n", something[34][24]); delete [] something;
  4. Temps

    float something[1000][1000]?

    To allocate dynamically use the following syntax for a float array of 1000 by 1000:- float (*something)[1000]; something = new float[1000][1000]; something[34][24] = 0.9f; printf("Output: %f\n\n", something[34][24]); delete [] something; // for completeness
  5. Temps

    float something[1000][1000]?

    I tried out your code (as a console application) and it worked for both cases. I'm guessing that the problem lies with the fact that you are blowing the 'stack'. Each 'float' takes 4 bytes of stack so 1000*1000*4 = 4,000,000 bytes and 'default' stack size is only 1MB. You can increase the...
  6. Temps

    call an API function from dos

    Don't know of a way of doing this (RunDll32 will not work with the Win32 APIs). However, it's extremely easy to write a simple EXE which does exactly what you want and returns the appropriate value to you cmd/bat file.
  7. Temps

    Use C++ to create XML file

    A better way would be to either use the Xerces code freely available on the Web or use the Microsoft (MSXML)COM component (also downloadable).
  8. Temps

    Killing a Thread

    The best way is to get the thread you wish to 'kill' to exit. You can do this by either posting a message to the thread (assuming you've got a message loop in the thread) or by using an event/semaphore to indicate to the thread that it can die. The other way is to call TerminateThread on the...
  9. Temps

    #import on a VB Dll

    When you instantiate the object are you checking that it's worked? E_POINTER errors can be caused by calling methods on a non-instantiated object. Temps
  10. Temps

    Background process

    Probably 'stub' program is a bit unclear - we tend to use the term for a program who's only intention in life is to launch another program. Not really sure what your requirement is having seen some of the discussions in this thread. However, if you want the 'background' program to be available...
  11. Temps

    Background process

    Not actually a VC++ issue. There are several ways of doing this programmatically:- 1) Write a 'stub' executable which does a CreateProcess on the actual program you want as a background process. CreateProcess lets you set the 'priority' you want the new process to run at. 2) Call...
  12. Temps

    DLL Registered or Not

    COM 'abstracts' object implementation details thus enabling a program to not have to worry, or make assumptions, about how (or where) an object is implemented - could be a DLL, EXE or remote machine; it shouldn't matter. However, when requesting an object to be instantiated you can insist you...
  13. Temps

    CreateThread problem...

    private makes sense. You don't need to cast - the 'signature' of the static member function already matches what CreateThread is expecting. Temps
  14. Temps

    CreateThread problem...

    Matt, If you want to pass a pointer to a member function of a class, the member function must be declared as 'static' (the problem is that there is a hidden 'this' pointer for every non-static member function). Within the header file declare public: static DWORD WINAPI...
  15. Temps

    Sending messages

    Why not use MSMQ or IBM MQSeries? Each PC can, I believe, filter the MQ messages so that they will only see what's destined for them.
  16. Temps

    TCHAR*

    Your syntax is wrong. Change Function(&buf[0]) to Function(buf) Temps
  17. Temps

    Unresolved External Error when using static member variables... help?

    When you declare a static member variable in a class, you also have to allocate storage for it as follows: class Foo { private: static int i; }; int Foo::i; The fact that you haven't allocated storage will give the 'Unresolved External' error. Temps
  18. Temps

    Help with SetState() GetState()?

    The SetState and GetState methods need to be 'public' as they will be called by instances of the class - if they were 'private' they would only be callable within the actual class code itself. The data behind the SetState and GetState methods can either be different for each instance of the...
  19. Temps

    How to implement automation to other win32 applications?

    Typically, you can use the API 'CreateProcess' to start another application and pass parameters to it. If it doesn't accept parameters on the command line, you could try sending the appropriate keystrokes to the application. Temps
  20. Temps

    Need to convert from C to C++

    Assuming cFname and cLname are declared as char *, this should work:- BankAccount::BankAccount() { cFname = new char[ARY]; cLname = new char[ARY]; iIDNumber = 0; } BankAccount::~BankAccount() { delete [] cFname; delete [] cLname; } Regards, Temps

Part and Inventory Search

Back
Top