Hello,
who can help me ???
I develop an application for PocketPC 2003 with eMbedded Visual C++
4.0 and use a dll, which e.c. has an function to open maps (*.shp)
and Orthophotos (georeferenced JPGs).
While testing the application, I saw, that there is a problem by
opening JPGs. The debugger shows the following message:

First-change exception in <meineAnwendung>.exe: 0xC0000005: Acess
Violation

The exception comes, when the function in the dll is called:

bool CGeoPADCtrl::GeoPAD1(BSTR filePath)
{
bool (PASCAL *fun1)(BSTR FilePath);
//GetProgAddress gets Adress of the function in the dll
(FARPROC&)fun1 = GetProcAddress(hInstasnce,_T("GeoPAD1"));

if(fun1)
//calles the function
return fun1(filePath); <-- here occurs the exception

return false;
}

Can anybody say me, what's the reason for such an exception ???
Is the error in the dll, and if yes, how could I repair it ???

Please give me your soon answer, I'm happy about every answer !!!!

Sandra

Re: Access Violation by calling function in Dll by Joint_Sense

Joint_Sense
Sun Jan 23 10:19:20 CST 2005

Have you "LoadLibrary" yet? Is the DLL specifically built for Pocket PC
2003?

If the problem is with the DLL, you cannot fix it yourself because it is
compiled code. Contact the developer and see if they can fix the problem
for you.

--
Email: developer@jointsense.com.hk
Homepage: http://www.jointsense.com.hk/
GMT: +8


"Sandra" <sandraexner@web.de> wrote in message
news:702c41c6.0501230747.5f192429@posting.google.com...
> Hello,
> who can help me ???
> I develop an application for PocketPC 2003 with eMbedded Visual C++
> 4.0 and use a dll, which e.c. has an function to open maps (*.shp)
> and Orthophotos (georeferenced JPGs).
> While testing the application, I saw, that there is a problem by
> opening JPGs. The debugger shows the following message:
>
> First-change exception in <meineAnwendung>.exe: 0xC0000005: Acess
> Violation
>
> The exception comes, when the function in the dll is called:
>
> bool CGeoPADCtrl::GeoPAD1(BSTR filePath)
> {
> bool (PASCAL *fun1)(BSTR FilePath);
> //GetProgAddress gets Adress of the function in the dll
> (FARPROC&)fun1 = GetProcAddress(hInstasnce,_T("GeoPAD1"));
>
> if(fun1)
> //calles the function
> return fun1(filePath); <-- here occurs the exception
>
> return false;
> }
>
> Can anybody say me, what's the reason for such an exception ???
> Is the error in the dll, and if yes, how could I repair it ???
>
> Please give me your soon answer, I'm happy about every answer !!!!
>
> Sandra



Re: Access Violation by calling function in Dll by Manuel

Manuel
Sun Jan 23 12:08:11 CST 2005

"Joint_Sense" <developer@jointsense.com.hk> schrieb im Newsbeitrag
news:OHDDkdWAFHA.1404@TK2MSFTNGP11.phx.gbl...
> Have you "LoadLibrary" yet? Is the DLL specifically built for Pocket PC
> 2003?
>

the dll has to be loaded since the result of GetProcAddress is checked...

I have the feeling that the prototype of the function

bool (PASCAL *fun1)(BSTR FilePath);

is wrong. Most exported function of shared dlls use C-types, that is BOOL
instead of bool. (BOOL is int, 4 bytes!)
PASCAL should be WINAPI (well, I like that better, they're both __stdcall)
and finally BSTR...
BSTR is OLECHAR which is unicode...
Now I've worked a little something with ESRI's ArcView... it seemed to be
more the ASCII-type, so perhaps you should try char*

Another thing: You could debug your app step by step to see what the
function does, that is how EBP (Emulator) is used and if there is for
example another param needed.

> If the problem is with the DLL, you cannot fix it yourself because it is
> compiled code. Contact the developer and see if they can fix the problem
> for you.

Or write it yourself ;-)

> --
> Email: developer@jointsense.com.hk
> Homepage: http://www.jointsense.com.hk/
> GMT: +8
>
>
> "Sandra" <sandraexner@web.de> wrote in message
> news:702c41c6.0501230747.5f192429@posting.google.com...
>> Hello,
>> who can help me ???
>> I develop an application for PocketPC 2003 with eMbedded Visual C++
>> 4.0 and use a dll, which e.c. has an function to open maps (*.shp)
>> and Orthophotos (georeferenced JPGs).
>> While testing the application, I saw, that there is a problem by
>> opening JPGs. The debugger shows the following message:
>>
>> First-change exception in <meineAnwendung>.exe: 0xC0000005: Acess
>> Violation
>>
>> The exception comes, when the function in the dll is called:
>>
>> bool CGeoPADCtrl::GeoPAD1(BSTR filePath)
>> {
>> bool (PASCAL *fun1)(BSTR FilePath);
>> //GetProgAddress gets Adress of the function in the dll
>> (FARPROC&)fun1 = GetProcAddress(hInstasnce,_T("GeoPAD1"));
>>
>> if(fun1)
>> //calles the function
>> return fun1(filePath); <-- here occurs the exception
>>
>> return false;
>> }
>>
>> Can anybody say me, what's the reason for such an exception ???
>> Is the error in the dll, and if yes, how could I repair it ???
>>
>> Please give me your soon answer, I'm happy about every answer !!!!
>>
>> Sandra
>
>