Archived

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

Passing string from vb to dll

This topic is 5976 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