OpenFile()

I need help using open file, a module (.dll) actually. I have somthing like this:

 

dim myModule as [Module]

and i need to make myModule equal somthing

like myModule = openFile("module.dll")

 

I looked for examples online and found nothing of use

 

PS. Actually the goal here is I am trying to inject a dll into a process of mine. I am having a problem though with the proper decleration of the dll. If anyone knows anything more specific about that it would be great, but I think I should be able to make due as soon as I get the openfile api down.




Answer this question

OpenFile()

  • patelucla

    You've asked this question in more than one thread. If you want to "inject" the DLL into a process that's yours, just add the DLL as a reference to your process' project. If you want to inject it into another process, it sounds like you're trying to create a virus... Please explain why you need to inject anything.


  • Heistgonewrong

    You must add this dll as a reference (Project => Add Reference...), then you can define a variable normally...
    Dim MyMod As New [...]


  • Renee Rinker

    Can you say a little more.

    Why do your need a DLL to open a file



  • xmh

    There is a way to do something like this in VB (this example is from 2003).  However, you have to have a common base class or interface in order to do anything useful with these dll's once you load them.

     

    Dim objIFace As BaseInterfaceClass

    Dim oh As Runtime.Remoting.ObjectHandle = Activator.CreateInstanceFrom("SomeLibrary.dll", "SomeLibrary.SomeClass")

    objIFace = CType(oh.Unwrap, BaseInterfaceClass)


  • Valerio Maarek

    A while back I was looking to do something like this and no one would help me for the same reason nobugz stated. I was trying to write a program that would loop though App.Path & "\Modules" and load all the *.dll's as 'modules' from there it would call the dlls routine ModuleInit() which would return a string that would be unserialized and used to build some GUI.
    Everyone thought it was a stupid idea, or I was trying to make a virus or thought I should move to .NET

    I ended up having to Shell "regsvr32 " & DLLName then Module(i) = CreateObject("blah.blah"), but I don't care for that method, be nice to find something like C's
    LoadLibrary.

  • OpenFile()