|
While you can get the exported function table by examining .dll executable file (which uses PE format), you can't answer very important question: what are the parameters and what's the return type.
Even if you could, how could .exe get the advantage of new function - at the moment you write .exe you have no idea what new function will be doing and when should you call it.
Tomasz Sowinski -- http://www.shooltz.com
*** Vodka. Connecting people. ***
|
|
|
|
|
Well I do know the function name and exact parameters. I'm actually writing the .DLL and .EXE.
My Idea was to have some kind of small database in the actual DLL that will keep list of the functions it provides along with the parameters, and maybe .exe will call say GetSupportedFunctions() and will know exactly what functions are there and waht parameters they take. Deciding when to call what function, shouldn't be a problem! However my problem is figuring out, how to call these functions.
Or is this possible at all?
Regards,
Venet.
Donec eris felix, multos numerabis amicos.
|
|
|
|
|
Venet wrote:
However my problem is figuring out, how to call these functions.
Getting the address of function is easy when you have function name (GetProcAddress). But you need to call the function with right parameters, and this would be quite difficult. I guess you'd have to code this part in assembly language.
I still can't see why would you like your .exe to invoke functions unknown when you develop the .exe itself. Enlighten me please
Tomasz Sowinski -- http://www.shooltz.com
*** Vodka. Connecting people. ***
|
|
|
|
|
Well, the .exe will be unable to do the right thing with new functions in .dlls anyway.
I'd split current exe into small .exe program listening for updates and main .dll which contains the core functionality. If new functions appear, .exe unloads the main .dll and replaces it with the updated one which knows what to do with updated plugins.
Tomasz Sowinski -- http://www.shooltz.com
*** Vodka. Connecting people. ***
|
|
|
|
|
Thank you for the suggestion.
Regards,
Venet.
Donec eris felix, multos numerabis amicos.
|
|
|
|
|
or use plugin style dlls. have the exe scan a particular dir, and attempt to load each dll present, in turn. each dll should have an identical entry point.
Signature space for rent. Apply by email to....
|
|
|
|
|
Yes, but I've got an impression that 'identical entry point' doesn't apply in his project.
Tomasz Sowinski -- http://www.shooltz.com
*** Vodka. Connecting people. ***
|
|
|
|
|
I want to display a graph on my property page.
There appears to be many methods for doing this in MFC. e.g. ActiveX, COM, OLE, using existing libraries C++. I'm looking for the least time consuming method.
The simple MS Excel graphing techniques are sufficient for my needs. The data will produce simple non-linear relationships from data stored in CMyProjDoc.
Any ideas?
Kash
|
|
|
|
|
Least time consuming method is ripping method. Get it here[^].
if you start putting in too manay features, it no longer remains useful for beginners
quote in a CP article comment, shiraz baig
|
|
|
|
|
I've been doing some research and found I can place an ActiveX control on my property page. This control takes the form of MsChart. How can I link the data to this chart?
Kash
|
|
|
|
|
When I write the following, perfectly ordinary code:
pItem = new CItem;
I get this message:
error C2660: 'new' : function does not take 3 parameters
???
When I write the same code in another cpp file (for the same CItem) it work's fine. What's going on here?
Regards, Haakon.
|
|
|
|
|
Are you overriding operator new in the file which causes problem?
Tomasz Sowinski -- http://www.shooltz.com
*** Vodka. Connecting people. ***
|
|
|
|
|
May be it is #include <crtdbg.h> or #define DEBUG_NEW or #define _CRTDBG_MAP_ALLOC or something else similar to it. Do you have anything like that? Compare #includes and macros in both files.
|
|
|
|
|
Yes, that's it! Operator new is overridden, and that doesn't go well with DEBUG_NEW. In the file where new works I had the #define new DEBUG_NEW commented out. I remember now. Sorry
I don't understand why, though. But never mind. Problem solved.
Thanks for your help.
|
|
|
|
|
Operator new with 3 params is used only in debug version. 2'nd param is module name, the third - line number. It gives possibility to you to find out memory leaks without any hardships
|
|
|
|
|
Hi
Quick question:
Can one OR (||) compiler directives, such as:
IFDEF ( xxxx || yyyy )
ENDIF
Thanks
Rui
|
|
|
|
|
Use '#if' and 'defined':
#if defined(XXX) || defined (YYY)
...
#endif
Tomasz Sowinski -- http://www.shooltz.com
*** Vodka. Connecting people. ***
|
|
|
|
|
Hey,
I have written an executable to capture mouse/keyboard events and play these back after. The function basically writes the message data to a text file, and reads it back in for playback.
I now need to put this into a COM DLL so that I can call it from a VBScript to get a playback.
The problem i have is with the ::SetWindowsHookEx function. I call it as follows
g_hHoohPlayBack = SetWindowsHookEx(WH_JOURNALPLAYBACK, JournalPlaybackFunc, LoadLibrary((LPCTSTR) "TRShell"), 0);
and in the callback JournalPlaybackFunc function, i use this to recreate the mouse/keyboard event
PostMessage(HWND_BROADCAST, WM_SERVICE_INFO, SI_S_PB_WAIT, lReturnValue);
It seems to be going into the callback function ok, but there is a problem with the Postmessage parameters. This code worked fine for the executable, but not when i use it in a dll and call from VB. Nothing happens.
Thanks for any help
tony
|
|
|
|
|
hello,
I have made a program in C++ , now i want to add the functions and structures to my an VC++ 6.0 MFC application . i have made a header file (-->"wioctl.h") and added all the functionality and structures in it.
Now when i include this file in more than one file including Application.cpp , it gives a linking error for all the functions and structurs -->> function <myfunction> already defined in Application.obj
|
|
|
|
|
You shouldn't add function definitions in .h, only functions declarations (prototypes) and structure types. Split wioctl.h into wioctl.h and wioctl.cpp.
Tomasz Sowinski -- http://www.shooltz.com
*** Vodka. Connecting people. ***
|
|
|
|
|
Tomasz Sowinski wrote:
You shouldn't add function definitions in .h, only functions declarations (prototypes) and structure types.
...Or you must use inline functions
|
|
|
|
|
... or static functions or ones defined in anonymous namespace.
The question is, should the still be in .h file? Without actual functions, nobody is able to answer this
Tomasz Sowinski -- http://www.shooltz.com
*** Vodka. Connecting people. ***
|
|
|
|
|
Perhaps use this in your header file:
#if !defined(MYHEADERFILE_H)
#define MYHEADERFILE_H
#endif
Because this header is used by other files, it could be redefine...
Hello World!!!
from Raphaël
|
|
|
|
|
hi,
I have an SDI application. I have a splitter with left and rigth view . I have added a list in left view.
Now i want that whenever any of the nodes in left view is clicked, the view in the right change and show some data, if other is clicked some other data is shown And every right view should retain its data .
how can i do it ??
thnx,
|
|
|
|
|
Handle LVN_ITEMCHANGED in left view and change the right view accordingly. What kind of window is the right view?
Tomasz Sowinski -- http://www.shooltz.com
*** Vodka. Connecting people. ***
|
|
|
|