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.

PureGDK / VS2008 CLR/Windows Forms Application...

Author
Message
WLGfx
16
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 22nd Aug 2011 23:50
I'm in the process of trying to set up a project using a windows forms app setup in the CLR. But in case it doesn't work.

Will it work with PureGDK?

Warning! May contain Nuts!
Mistrel
Retired Moderator
18
Years of Service
User Offline
Joined: 9th Nov 2005
Location:
Posted: 23rd Aug 2011 03:24
I have not tried this before but I don't see why it wouldn't work. DarkGDK is statically compiled so it can't be used with a virtual machine like the CLR. PureGDK is dynamically linked so it should be ok.

I don't know how C++/CLR deals with "compiling" and "linking" .cpp files. Hopefully it will be very similar to regular C++.

WLGfx
16
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 23rd Aug 2011 03:36 Edited at: 23rd Aug 2011 04:17
I've been going through some tutorials on how to use the CLR side of VS. Very rusty at the moment and having a few initial difficulties. What I want to get done is to use WinApi forms in VC express and a blank borderless form and pass it's hWnd handle to PureGDK...

EDIT: Nah, just Visual Studio Express and Resedit... CLR don't seem too friendly...

Warning! May contain Nuts!
WLGfx
16
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 23rd Aug 2011 21:32 Edited at: 23rd Aug 2011 21:40
Quote: "d:\cpp\win32_pgdk\test2\include/initPureGDK.h(29) : error C2664: 'LoadLibraryW' : cannot convert parameter 1 from 'const char *' to 'LPCWSTR'"


I get this error when it's trying to convert std::string path to LPCWSTR. Apart from re-writing the initPureGDK() function to get it working is there a quicker way?

What I did find was this:
Quote: "Resolution

You will have to do one of two things:

Change your project configuration to use multibyte strings. Press ALT+F7 to open the properties, and navigate to Configuration Properties > General. Switch Character Set to "Use Multi-Byte Character Set".
Indicate that the string literal, in this case "Hello world!" is of a specific encoding. This can be done through either prefixing it with L, such as L"Hello world!", or surrounding it with the generic _T("Hello world!") macro. The latter will expand to the L prefix if you are compiling for unicode (see #1), and nothing (indicating multi-byte) otherwise."


I don't really want to convert the entire project to a multi-byte character set.

EDIT: Setting up a new project I think I skipped a few steps...

Warning! May contain Nuts!
Mistrel
Retired Moderator
18
Years of Service
User Offline
Joined: 9th Nov 2005
Location:
Posted: 24th Aug 2011 06:32
LPCWSTR is for Unicode which isn't compatible with PureGDK because the DarkBasic Professional plugins it uses are compiled for ASCII.

C++/CLR should work with ASCII if configured properly.

Login to post a reply

Server time is: 2024-04-24 05:49:35
Your offset time is: 2024-04-24 05:49:35