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


Passing string from vb to dll

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