If you want to return 'sText', you must ref the var. Try this: [DllImport("BabMD5.dll")] static extern long EncodeText( string p_password, ref string p_encText, long p_size); EncodeText("testestest",ref sText,33); The Internet Give a Chance to Learn. I Do!
You can use the Assembly class to load assemblies at runtime, the GetType function to get an object's type, and the Activator.CreateInstance static function to create an object of that type:
Assembly a = Assembly.Load("MyLibrary");
Type t = a.GetType("MyLibrary.MyClass");
object obj = Activator.CreateInstance(t);
cheers, Chris Maunder (CodeProject)
Did you register your dll? Read this page.. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpapndx/html/\_cor\_deployment\_and\_configuration.asp update: also this link.. depending on what you're doing.. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cptools/html/cpgrfassemblyregistrationtoolregasmexe.asp
The things you need is located in the namespace System.IO... I would do it like this:
using System.IO;
public void FindFiles (string path)
{
if (Directory.Exists (path))
{
DirectoryInfo thisDir = new DirectoryInfo (path);
FileInfo [] files = thisDir.GetFiles ("*url");
DirectoryInfo [] subDirs = thisDir.GetDirectories ();
foreach (FileInfo f in files)
{
//Do what you should with the files...
}
foreach (DirectoryInfo d in subDirs)
{
FindFiles (d.FullName);
}
}
}
Andreas Philipson
Basically, what you'll need to do is use the Word OLE interface from COM interop. As a first step, in VS you add a reference to the word exe (I think) to your project, and that will give you a managed wrapper around the COM interfaces. You can also do this from the command line with tlbimp.
.net runtime is the child of Pcode. Pcode is semi-compiled thingy whatsit (dam shit I've forgotten the word for it). Any way this Pcode can in many cercumstances run faster or be smaller than its local machine specific counterpart. I bet you want me to explain how don't you? Darn it man, its been a million years since I read this in Program Now (do you remember that one, sigh, memories). Its something to do with the way Pcode can share functions at a level very close but not quite at machine level. Oh bugrit I can't remember. It just is ok!? We do it for the joy of seeing the users struggle.
Hi, Your DLLs will be able to be used in both Winforms and Webforms. The efficiency of the implementation depends on the how you use the DLLs. If you want to talk about it some more, I would need to know a little more about the application (client and server side) architecture. Cheers! Colin
The class 'System.ControlPaint' has some methods with the name 'Reversible' in them that draw onto the screen. If you use FillReversibleRectangle then you could draw four of them to get the drag rectangle you are looking for. There is only one problem with this though, you have to give a Color and so it will be a solid border around your control and not the stipled effect you want.
Thanks. Thats the way I tried it, though something you said made me think about the size and hence error 87. I tried a couple of pointer tricks and it worked! Again thanks for the tip on the change from LPVoid to IntPtr(If it was indeed a change :) )