|
Post by Adam on Jul 3, 2010 19:52:07 GMT -5
I am writing a dll to use in my ftp client in place of Nicky's but I ran into a problem having to do with the way basic4gl uses strings in plugin functions. in this code temp returns 0 so you get the error message void DLLFUNC Func_renamefile(IDLL_Basic4GL_Runtime &basic4gl) { const char *oldName = basic4gl.GetStringParam(1); const char *newName = basic4gl.GetStringParam(2); int temp = rename(oldName,newName); if (!temp==0) { MessageBox(NULL, "Error", "Plugin", MB_OK); } } This code however actually renames the file as it should void DLLFUNC Func_renamefile(IDLL_Basic4GL_Runtime &basic4gl) { const char *oldName = "file1.txt"; const char *newName = "file2.txt"; int temp = rename(oldName,newName); if (!temp==0) { MessageBox(NULL, "Error", "Plugin", MB_OK); } }
|
|
|
Post by Adam on Jul 4, 2010 13:53:23 GMT -5
i got it, had the input and output file backwards forgot that the first in the function is the last in the array.
|
|
|
Post by DJLinux on Jul 7, 2010 5:57:51 GMT -5
i got it, had the input and output file backwards forgot that the first in the function is the last in the array. Yes the order of parameters are a really pitfall in the Plugin interface. If somethings goes wrong i check the order of params at first. Joshy
|
|