Click to See Complete Forum and Search --> : how to call a dll function from embedded visual c++
tomascruz
01-09-2003, 07:11 PM
i have created a dll in embedded visual c++ and compiled and registered in the windows ce emulator, now, i want to call a function from another program. in that program i call a function from the dll, but when i build it, generates an error telling me that the function doesn't exist, maybe it's because i've not registered the dll in the desktop computer, but when i try to register the dll, is not possible because it is the dll for the windows ce, how can i call a function from that dll in the program?
bettyboop
01-09-2003, 07:22 PM
Have you tried the same Dll on the actual PDA?
Does it work or not work?
Non com dll's do not need registering.
If it works then it should work in the emulator as long as
you transfer the file to the emulator using empfile.exe
Good luck
:rolleyes:
tomascruz
01-10-2003, 09:47 AM
the actual problem is that i can't compile the client program, so i can not download to the emulator or pda, and i do not know if my dll, (already compiled and downloaded to the emulator) is working or not, so, the only thing i want to know is what do i have to do to make a program recognize a function from a dll already compiled and downloaded to the emulator/pda when i'm compiling that program (the client) in embedded visual c++
tomascruz
01-10-2003, 09:52 AM
sorry, i didn't thank you for the last reply!!
bettyboop
01-10-2003, 10:11 AM
Sorry did you say the dll and your application works on the
actual PDA? If so I must have missed it.
If your program is working on the actual PDA then you will need
to use as stated earlier the program called empfile.exe to
copy the necessary files to the emulators folder and run the
app from the emulator. Unless you use empfile.exe your file
is never in the actual emulators virtual folde during runtime.
Good luck
:D
tomascruz
01-10-2003, 12:24 PM
no, no, the only thing that compiles and works is the dll, the application doesn't even compile because i have a call to a dll function and the application doesn't recognize that function, so, when i try to compile my aplication, generates the following error:
error C2065: 'guardaFecha' : undeclared identifier
and guardaFecha is the name of a function in the dll, so, i think that the embedded visual c++ is looking for the functions in the desktop dll registers, and i tried to register that dll with regsvr32 in the pc, but it generates an error and it doesn't register it maybe because it's compiled for windows ce, and the embedded visual c++ doesn't have an option for compile por pc
and where do i get the empfile.exe? i suposse that when i compile and build the dll it is registered automatically and ready to use in the emulator, because it says ¨succesfully registered \windows\files.dll to emulation¨
and thanks again for the answer
:confused:
bettyboop
01-10-2003, 12:49 PM
First have you ever created a Dll before that you have successfully used in an application?
Dll's can compile with all sorts of junk code without working from
an external application. Really a DLL is an EXE that has internal
code thats exported out.
Are your functions in the DLL created to be exported out?
This is a sample explanation extracted from a sample DLL's.
The following ifdef block is the standard way of creating macros which make exporting from a DLL simpler. All files within this DLL are compiled with the MIDIPORT_EXPORTS symbol defined on the command line. this symbol should not be defined on any project that uses this DLL. This way any other project whose source files include this file see MIDIPORT_API functions as being imported from a DLL, where as this DLL sees symbols defined with this macro as being exported.
#ifdef MIDIPORT_EXPORTS
#define MIDIPORT_API __declspec(dllexport)
#else
#define MIDIPORT_API __declspec(dllimport)
#endif
This is from the header file.
The actual MIDIPORT_API created in this case is compiled
within the actual MIDIPORT.dll file I use.
Hope this helps you. Beyond this explanation I think it would
be more confusing without understanding how the interaction
between the DLL and the application works first.
Once you get an application working on the actual device then
we can worry about getting it to work on the emulator.
Good luck
tomascruz
01-10-2003, 03:02 PM
thanks a lot, but one more thing, do you have a sample source code of a dll? can you send it to me? thanks
bettyboop
01-10-2003, 03:29 PM
EVC++ has all the samples you need.
Take a good look into the SDK's subfolders.
Good luck
tomascruz
01-10-2003, 04:06 PM
sorry bothering you again, but i just cant find any examples, there are only examples in evb, or maybe i didn't installed that part (this pc is going out of disk space, only 100MB left!!, and there's a lot of thing here i can not delete), i looked for it in all the folders and look for all the folders called samples, and i just find evb examples, where are them?
bettyboop
01-10-2003, 04:30 PM
Sorry but looks like you have to refer back to the CD or the
original install file.
The other option is try
www.support.microsoft.com and do a search for a sample.
Good luck
Otherwise you can go here for help too.
www.technobrains.com
PDA Street
Copyright Internet.com Inc. All Rights Reserved.