|
|
Check out the LoadLibrary API. To retrieve the address of the function you need to call, use the GetProcAddress API with the handle returned by LoadLibrary .
Have fun.
|
|
|
|
|
Doh!
I knew it was simple one. 1 more question. I thought there was some linking option that I needed to turn on or off to force a dynamic load of the dlls. Is this true, or does the adding of the Load Library take care of that issue?
Once again, Thanks alot!
Dan Willis
|
|
|
|
|
You should prototype your export functions with extern "C" in order to avoid name mangling. Anyway, take a look at the DLL's link map or export list to make sure the functions do get exported with human-readable names (the ones you will have to use in GetProcAddress ).
Have more fun!
|
|
|
|
|
Even Better! Woo Hoo!
Another question to have even more fun!
How do I look at the dll link map and/or export list?
Dan Willis
|
|
|
|
|
Try this: go to the Project Settings dialog (Alt+F7), select the Link tab, in the Category combo choose "Debug". A checkbox named "Generate mapfile" should be there. Use it when compiling your DLL, and look for any generated .MAP files on your output directory. These are text files.
|
|
|
|
|
Ok,
Great! Thank you soo much! I really appreciate this! It helps me alot in there becuase sometimes the MSDN just gives a little bit too much information and/or it can be difficult to find exactly what you are looking for.
I greatly appreciate your time Joao (I can't make the squiggly).
Thanks!
Dan Willis
|
|
|
|
|
Anytime! This is the spirit of the CodeProject. You cannot imagine how much I learn here everyday, so I feel as my obligation to return some back.
João Paulo
|
|
|
|
|
Use the Dependency Walker tool (Depends.exe). It should be part of your VC++ studio installation.
Art
|
|
|
|
|
Well, I'm having fun, more fun, wahoo! now I'm stuck again. Here's my exported function declaration:
EXPORT char *get_compile_date();
And here's what I'm doing to get it:
typedef LPSTR (CALLBACK* LPFNDLLFUNC1)();
LPSTR strResult;
HINSTANCE hToDLL;
LPFNDLLFUNC1 lpfnDllFunc1; // Function pointer
hToDLL = LoadLibrary(app);
// If the app doesn't exist, then forgettaboutit
if (app == NULL) return NULL;
sprintf(dllVersionString,"%s compiled on ",app);
lpfnDllFunc1 = (LPFNDLLFUNC1)GetProcAddress(hToDLL,"get_compile_date");
if (lpfnDllFunc1 != NULL)
{
// call the function
strResult = lpfnDllFunc1();
if (strResult == NULL) return NULL;
}
I get the dll handle back fine, but the GetProcAddress always returns NULL. Here's the line in the mapping file from the dll containing that function:
0001:000110a0 _get_compile_time 100120a0 f timestamp.obj
What am I doing wrong here that is causing the GetProcAddress to fail?
Dan Willis
|
|
|
|
|
At a glance you need to change:
if (app == NULL) return NULL;
to:
if (hToDLL == NULL) return NULL;
-------------------------------------
Art
|
|
|
|
|
how to check if a a handle - file handle, pipe handle, thread handle etc - is available?
thx
includeh10
|
|
|
|
|
|
How can i change my window into arabic style ?
which means by default the window is left to right change it to right to left
Manikandan Balachandran
|
|
|
|
|
I have installed .NET but it seems to be running alot slower than 6.0 did. Is there a way of speeding it up??
Also, how do I get the class view, resource view and solution explorer as one view. They are all separate at the moment..
Thanks,
grahamoj.
|
|
|
|
|
grahamoj wrote:
Also, how do I get the class view, resource view and solution explorer as one view. They are all separate at the moment..
Drag the windows which are separately (docked?) to the place where you want them to be, f.i. drag the resource view over the place where the tab of class view is situated.
We are men. We are different. We have only one word for soap. We do not own candles. We have never seen anything of any value in a craft shop. We do not own magazines full of photographs of celebrities with their clothes on. - Steve
|
|
|
|
|
grahamoj wrote:
I have installed .NET but it seems to be running alot slower than 6.0 did. Is there a way of speeding it up??
VS.NET consumes much more memory than VS6, that is something you need to get used to, but don't say you were not warned, review the system requirements and recommondations for VS.NET, they are high.
I turn-off Dynamic Help, I think that might help a little.
R.Bischoff | C++
.NET, Kommst du mit?
|
|
|
|
|
Hello,
I am soon going to be sending some major projects for translation.
In my situation, development and translation happen in parallel.
This means that sometimes by the time the translated resources arrive, there would already be changes to the original resources.
I need a solution to track these sort of changes automatically, and aid me as much as possible with the process.
Does anyone have any experiences he could share?
Are there tools available for this?
Thanks
Jeremy Pullicino
C++ Developer
Homepage
|
|
|
|
|
I use Visual Translate from www.alshare.com. Its a dictionary based translation tool, so you can develop and translate parallel. The worst case you got,is that some new resources are not translated and appear in the original language....
bb |~ bb
|
|
|
|
|
I had a look at the website, it looks like it is no longer available, states development may restart later.
If I have seen further it is by standing on the shoulders of Giants. - Isaac Newton 1676
|
|
|
|
|
I'm calling COleClientItem::UpdateLink to update my documents OLE items. These items can be sized (scaled) by the user, but when I call UpdateLink the object is scaled to it's original / actual size. Is there a way to prevent the automatic size updating? Or is there a work around? I tried the following
CSize size;
pItem->GetExtent(&size);
pItem->UpdateLink();
pItem->SetSize(size); But this requires the object to be activated (running), and my UpdateLink call has to be made when my document is opened, hence I don't want to have to have each object activated to update it/maintain it's size, just to deactivate it.
Dylan
|
|
|
|
|
|
I believe wchar_t is ANSI type. In fact according to MSDN wcscpy is ANSI compatible function.
|
|
|
|
|
In JavaScript you can determine if ActiveX is enabled, I have been trying to find a way to do this through VC++ but cannot find any information. I dont want to implement it as a hidden browser running JavaScript and then checking the result from the C++, there must be someway from C++ to do it directly. I would think the setting would be stored in the registry somewhere. Any help is appreciated.....
|
|
|
|
|
Hi,
I need to create an application that CREATES an MS Access table everytime it is executed, (with the data read from some files, no problem here), and offer the possibility to save it in the hard disk as .mdb.
I use VC++ 6.0
any ideas?
Thanks so much.
F
|
|
|
|