468,306 Members | 1,166 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,306 developers. It's quick & easy.

HELP !! pb calling eVC++ DLL from VB.NET on compact framework

hi all !

i need your HELP ! (it's long to explain but it's needed)

i have a big problem (for me) with my APP/DLL

i have made an Application with VB.NET for Compact framework that call an
DLL written in eVC++ 4.

the pb is i get a "First-chance exception ... Access violation" sometimes...

before my VB app are small (and i haven't the pb) but now is bigger (and i
have the pb all the time).

when i debug the DLL, at the exception if i continu, i often get a "stack
overflow"..

i have read many things on the net but i haven't found a solution for the
pb. it seem its a limit of 4k(or 64k) boundary page pb with the stack..
here the start of my DLL function :

char __declspec(dllexport) f_com_ReadAcq(char voie,double * pValeurs, int
*nbValeur)
{
UCHAR buffer[120000];
long sizeBuf=0;

ReceiveData_GetLast(&tdReceiveMemory, buffer,500, RECEIVE_DATA_ACQ, voie
,&sizeBuf);
...
...
}

in ReceiveData_GetLast i do some memcpy to "buffer" and it's these memcpy
that do exception...i have try to replace the memcpy by a soft loop then it
crash at same time..

the DLL function is called from many place on the vb.net app then in one
case (always the same) it work...

when it work, the &buffer = 0x2207F2CC
when it crash the &buffer = 0x22011f8c
when it crash the pointer to buffer = 0x22012000

i mean it's the 1FFF to 2000 boudary that cause crash...(4k page ??)

i mean i can use malloc to allocate my 120k buffer, but i'm afraid for the
rest of development...if i have only 116 bytes of local memory available
(0x22012000 - 0x22011f8c)...then this problem can appairs later in
development even if i make all array with malloc............

can it be VB.NET that fill the stack ?and how i can do to "free" some bytes
of the stack before calling DLL...?

thank a lot for all people that can help me....(i'm on this pb since 3 days
now and my app is not finished.....)

Eric BOUXIROT
(sorry for my bad english)

you can answer me at bo******@lgm.fr


Nov 21 '05 #1
0 808

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Hans Kesting | last post: by
reply views Thread by Eric BOUXIROT | last post: by
2 posts views Thread by delphine_fontaine | last post: by
2 posts views Thread by delphine_fontaine | last post: by
2 posts views Thread by =?Utf-8?B?VmljdG9yIExhaQ==?= | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.