Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Access Violation

Author
Message
Ashy
18
Years of Service
User Offline
Joined: 1st Nov 2005
Location:
Posted: 22nd Aug 2006 15:49
Could anyone tell me if i'm using this right please..



I get an access violation when it runs... i know its those lines because if i comment it out then everythings fine. I did have a go at loadlibrary and getprocaddress, i tried copying the example from msdn and changing it to suit my needs but i couldn't get it to work.. handles, pointers .etc can be a bit confusing for noobs

I'll keep at it tho.
OSX Using Happy Dude
20
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 22nd Aug 2006 16:16
Try :



Come to the last Unofficial DBPro Convention (http://convention.logicstudios.net/)
Supplying "NO" since 1974...
Ashy
18
Years of Service
User Offline
Joined: 1st Nov 2005
Location:
Posted: 22nd Aug 2006 16:40
Thanks but doesn't work... i get ;

Quote: "1>.\main.cpp(127) : warning C4311: 'type cast' : pointer truncation from 'const char *' to 'DWORD'
1>.\main.cpp(129) : warning C4311: 'type cast' : pointer truncation from 'const char *' to 'DWORD'
1>.\main.cpp(129) : warning C4311: 'type cast' : pointer truncation from 'const char *' to 'DWORD'
1>.\main.cpp(129) : warning C4311: 'type cast' : pointer truncation from 'const char *' to 'DWORD'
1>.\main.cpp(129) : warning C4311: 'type cast' : pointer truncation from 'const char *' to 'DWORD'
1>.\main.cpp(129) : error C2664: 'WritePrivateProfileStringW' : cannot convert parameter 1 from 'DWORD' to 'LPCWSTR'
1> Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast"


Which is why i was using (LPCWSTR)...looks like it should work.. but like i said.. if i comment it out everything is ok.. and my program isn't that big at all, yet so i doubt its anything else thats causing this problem.

It said something about writeprivateprofilestring returning a bool value.. so i tried

bool a;

a=dbcalldll(blahblah .etc

but it didn't work.
Ashy
18
Years of Service
User Offline
Joined: 1st Nov 2005
Location:
Posted: 22nd Aug 2006 16:44
I tried dwordin the writeprivate and then lpcwstr the rest.. but still no avail.
Ashy
18
Years of Service
User Offline
Joined: 1st Nov 2005
Location:
Posted: 22nd Aug 2006 17:08
Woo I got it... Thanks philbert, you were right, I just left out a bracket or two.. I saw your post and typed it in.. didn't work.. then i came back and copy n pasted.. my fault. Thanks alot. Now I can get on with my work
EddieB
19
Years of Service
User Offline
Joined: 29th Sep 2004
Location: United Kingdom
Posted: 22nd Aug 2006 21:00
Why are you using db sdk to call win32 functions in C++

use the code I gave you before:

Login to post a reply

Server time is: 2024-06-17 07:29:02
Your offset time is: 2024-06-17 07:29:02