If you know c/c++, could you take a look at this thread :
http://www.vbforums.com/showthread.p...threadid=76121
Printable View
If you know c/c++, could you take a look at this thread :
http://www.vbforums.com/showthread.p...threadid=76121
I just looked at the C code and it looks pretty straight forward.
What message, if any, are you getting? Also, please post the Shell statement that you use to execute the app.
Well when I try to compile the code, I get these errors :
If I use his piece of code :Code:--------------------Configuration: share - Win32 Debug--------------------
Compiling...
share.cpp
c:\jamie\share.cpp(28) : error C2440: '=' : cannot convert from 'void *' to 'struct share_info_50 *'
Conversion from 'void*' to pointer to non-'void' requires an explicit cast
Error executing cl.exe.
share.exe - 1 error(s), 0 warning(s)
I dont get the above error, but get this one instead :Code:malloc(cbBuffer);
// instead of :
pBuf = malloc(cbBuffer);
And I would either stick the compiled executable into a login script, or shell it just as retVal = Shell("\\ntserver\shared\blah.exe")Code:--------------------Configuration: share - Win32 Debug--------------------
Compiling...
share.cpp
Linking...
share.obj : error LNK2001: unresolved external symbol __imp__NetShareAdd@16
Debug/share.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
share.exe - 2 error(s), 0 warning(s)
Try casting the result from malloc.
You need pBuf as it is the pointer to the memory area allocated by malloc.Code:pBuf = (struct share_info_50*) malloc(cbBuffer);
Okay that bit worked, but im still left with the second problem :
Code:--------------------Configuration: share - Win32 Debug--------------------
Compiling...
share.cpp
Linking...
share.obj : error LNK2001: unresolved external symbol __imp__NetShareAdd@16
Debug/share.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
share.exe - 2 error(s), 0 warning(s)
i`d suggest making sure you are including all relevant header (.h) files!
I've done a little looking around and I have to say I'm a bit mystified. At http://msdn.microsoft.com/library/ps...api3_8yk2.htm, it says share_info_50 is defined in srvapi.h, which you have as the last include in your code. However, I searched the header file and I can't find it.
I also saw that share_info_50 is not supported in Windows NT/2000. Will this be a problem for you?
Don't know how much more help I can be.
As far as I can tell I am.
I took the code as is off the microsoft website.
And as I know very little c my bug tracking is severly hindered :)
/me starts crying
:)
Emmmmm.
Well its all super confusing to me anyway.
And the fact that its not compatible with nt/2k will be a very big problem.