Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

JohnPC

Passing string from vb to dll

This topic is 6191 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''ve been developing my game as a VB app, with a C++ dll to handle the more ''intensive'' functions. In the dll, I have: void _stdcall LoadTerrain ( LPCSTR S) ... ifstream is( S, ios::binary | ios::nocreate ); ... and in VB: Public Declare Sub LoadTerrain Lib "Game.dll" (ByVal Filename As String) fs = "C:\\game project\\background.bmp" LoadTerrain fs My problem is simply, it doesn''t open the file. If I hardcode the filename in the dll, it works, but trying to pass it from VB nothing happens.

Share this post


Link to post
Share on other sites
Advertisement
Forget it. I just realized my mistake..
In C++, slashes in strings are \\.
In VB, slashes are just \.
*argh*.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!