|
I will give them a shot,guys!! Thanks!
|
|
|
|
|
Does anyone know of reasons why LoadFrom with a network UNC wouldn't work (ie \\server\share). I've messed with IE's security zones, share permissions. I would even be willing to use webshares (ie http://server/share) which work for the LoadFrom but you can't do directory info calls on URI's. I currently have a pluggin structure that works beautifully, except that I cannot load the pluggin dlls over the network on the UNC or I can't iterate the potential pluggins on the web URI.
If anyone has any suggestions please let me know. I will update this with solutions I find.
Tanka,
Ryan Cromwell
|
|
|
|
|
whats the exception that you get?
"When the only tool you have is a hammer, a sore thumb you will have."
|
|
|
|
|
An unhandled exception of type 'System.ArgumentException' occurred in mscorlib.dll
Additional information: Invalid URL.
====================
|
|
|
|
|
sounds like it does not like the format, have you tried a drive mapping?
or use a url format? file://
"When the only tool you have is a hammer, a sore thumb you will have."
|
|
|
|
|
ya i've tried using file:// but you can't iterate the files that way at least not with DirectoryInfo.
|
|
|
|
|
Hi there was a similar post about 1-2 weeks ago, I cant remmeber all the details, but it goes it little something like this (lepppie does the dance),
The SecurityPermissionFlags had to be set to Intranet.
Hope this helps or James sees this He provided the answer last time around.
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
Hi all
This does not seem to work, very weird. The function returns 632 which translates to "An incorrect structure size was detected". Now this is the definition of the Structure according to MSDN and header file.
typedef struct _RASENTRYNAME {
DWORD dwSize;
TCHAR szEntryName[RAS_MaxEntryName + 1];
#if (WINVER >= 0x500)
DWORD dwFlags;
TCHAR szPhonebookPath[MAX_PATH + 1];
#endif
} RASENTRYNAME;
I definine as :
[StructLayout(LayoutKind.Sequential)]
public class RASENTRYNAME
{
public int dwSize;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = (int)Max.MaxEntryName + 1)]
public string szEntryName;
public int dwFlags;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256 + 1)]
public string szPhonebookPath;
}
The function def:
[DllImport("rasapi32", EntryPoint = "RasEnumEntries", CharSet = CharSet.Ansi)]
public static extern int EnumEntries(object menull, System.Text.StringBuilder phonebookpath,[In, Out] IntPtr rasentry, ref int size, out int entries);
And use it as :
RASENTRYNAME rasentry = new RASENTRYNAME();
size = rasentry.dwSize = Marshal.SizeOf(typeof(RASENTRYNAME));
size *= 10;
IntPtr prasentry = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(RASENTRYNAME)) * 10);
first = prasentry;
Marshal.StructureToPtr(rasentry, prasentry, true);
result = RASWrapper.EnumEntries(null, null, prasentry, ref size, out numcon);
for (int i = 0; i < numcon; i++)
{
Marshal.PtrToStructure(prasentry,rasentry);
prasentry = new IntPtr(prasentry.ToInt32() + Marshal.SizeOf(typeof(RASENTRYNAME)));
}
Marshal.FreeHGlobal(first);
The other Enum functions in the DLL works fine, RasEnumConnections & RasEnumDevices, using the same code structure. Giving me correct values and doing exactly what it should.
I have tried everything (no kidding), but what is wrong here? Is the DLL broken?
Thanx all
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
I am building a smapp vcproj to test it. Will feed back later.
About RasEnumEntries, are you sure you call the right functions ? Dependency walker tells me there are 3 functions exported in rasapi32.dll : "RasEnumEntriesA", "RasEnumEntriesW", "RasEnumEntriesWow".
While you use explicitely ANSI charset, the "RasEnumEntries" should be mapped to "RasEnumEntriesA", but eh we are never sure of anything.
And I swallow a small raisin.
|
|
|
|
|
Thx Stephane
Like I said I have tried all those things, I'll mail what I have so far, doesnt look like much, but it is
CHeers
PS: What is the Wow for? 64-bit? Wide on Wide?
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
Just tested it with exactly your code. Same 632 error.
RasError.h says :
#define ERROR_INVALID_SIZE (RASBASE+32)
/*
* An incorrect structure size was detected.
*/
And I swallow a small raisin.
|
|
|
|
|
|
I have just tested the code you have forwarded me :
RASWrapper.EnumConnections --> fails
RASWrapper.RasEnumDevices --> ok
RASWrapper.EnumEntries --> fails
And I swallow a small raisin.
|
|
|
|
|
StephaneRodriguez wrote:
RASWrapper.EnumConnections --> fails
Does it fail (iow return != 0) ? If so, state error code plz.
It wont return values if u dont have an active dialup connection(s).
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
The return value in both cases is 632.
Indeed, that's what I was wondering, as I am not using dialup at all to connect.
And I swallow a small raisin.
|
|
|
|
|
Hmm, very strange....
These are my struct sizes with the results executed in the same order as the file i sent you.
EnumConnections
Size: 704
Result: 0
EnumDevices
Size: 152
Result: 0
EnumEntries
Size: 528
Result: 632
The API is bad for marshalling Maybe in C++ its easy, but I cant think why the function works so "stupidly".
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
OK i see i made a problem with MAX_PATH , iwas under the impression its 256 and not 260. DOPE
Now i get same results as u
I guess i'll have to play with the numbers then....
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
To avoid these number problems, wouldn't it be of interest to marshall a simple pointer, ie forget about SizeConst, ...
At least, this would be simplify marshalling.
And I swallow a small raisin.
|
|
|
|
|
I give up. I have tried setting the size of the struct from 0 to 20000 and it still returns 632. I think it is broken....
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
If I specify Unicode to function returns 50 and the structure stays unchanged. Also 50 has no meaning, except for DOS error codes...
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
Bloody Wtypes #$%#$%@#$%@!#$%@$#%$#%^%#^&$%^&#%^&#%^ ... continues for the next 50 pages....
As specified by MSDN:
LPCTSTR reserved, // reserved, must be NULL
Now THIS NULL is an int that must be set to 0 and NOT null as in a null object. Then everything works as it should.
Re other post about MAX_PATH, this one required 260, the other struct required 256. WTF is going on????
Nut Thanx for all your help Stephane
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
Now MS should smell the blood...
And I swallow a small raisin.
|
|
|
|
|
Hello
When I build my .msi, I get this error :
ERROR: 'shdocvw.dll' should be excluded because its source file
'C:\WINDOWS\System32\shdocvw.dll' is under Windows System File Protection.
So the .MSI package is built anyway, but the installed application doesn't
work because a file is missing ( the application works, except when I try to print or to show a preview. These functions use printDialog, printDocument, printPreviewDialog ...).
How do I include this component?
Thanks
Troz
|
|
|
|
|
Hi
Have you tried coping the file to the application folder instead of the SYSTEM dir?
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
yes
It doesn't work, because I can't make the link with the .exe
But this dll is present on the user machine. I think that we must use the dll present on the user machine.
troz
|
|
|
|