Passing string from vb to dll

Started by
0 comments, last by JohnPC 22 years, 8 months ago
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.
Advertisement
Forget it. I just realized my mistake..
In C++, slashes in strings are \\.
In VB, slashes are just \.
*argh*.

This topic is closed to new replies.

Advertisement