Click here to Skip to main content
15,921,716 members
Home / Discussions / C#
   

C#

 
GeneralPlease Help Me- Singleton problem Pin
Kraazykoder19-Jul-05 7:25
Kraazykoder19-Jul-05 7:25 
GeneralRe: Please Help Me- Singleton problem Pin
Mark Greenwood19-Jul-05 18:57
Mark Greenwood19-Jul-05 18:57 
GeneralRe: Please Help Me- Singleton problem Pin
S. Senthil Kumar19-Jul-05 19:27
S. Senthil Kumar19-Jul-05 19:27 
GeneralMicrosoft's Timezone Control Pin
korondy19-Jul-05 6:17
korondy19-Jul-05 6:17 
GeneralRe: Microsoft's Timezone Control Pin
Sean Michael Murphy19-Jul-05 11:01
Sean Michael Murphy19-Jul-05 11:01 
GeneralRe: Microsoft's Timezone Control Pin
korondy19-Jul-05 11:21
korondy19-Jul-05 11:21 
GeneralRe: Microsoft's Timezone Control Pin
Sean Michael Murphy19-Jul-05 11:39
Sean Michael Murphy19-Jul-05 11:39 
GeneralDynamically create COM objects in C# Pin
raymondlee19-Jul-05 6:12
raymondlee19-Jul-05 6:12 
I want to dynamically load DLLs (created from VB) and instantiate a class with a particular name, like "ProcessClass".

I am able to load the DLL and confirm there is a class by that name BUT I can't seem to create it or call methods to this newly created instance. I have the following code:

public class Script
{
[DllImport("oleaut32", CharSet=CharSet.Unicode)]
private extern static void LoadTypeLib(string dllFilePath, out UCOMITypeLib typeLibrary);

UCOMITypeLib typeLibrary;
LoadTypeLib(dllName, out typeLibrary);

for (int i = 0; i < typeLibrary.GetTypeInfoCount(); i++)
{
typeLibrary.GetDocumentation(i, out typeName, out typeDocumentation, out typeHelpContext, out typeHelpFile);
if (typeName == "ProcessClass")
{
UCOMITypeInfo typeInformation;
object classInstance;

typeLibrary.GetTypeInfo(i, out typeInformation);
typeInformation.CreateInstance(null, ref guidIUnknown, out classInstance);

MethodInfo method = classType.GetMethod("DoSomething", BindingFlags.InvokeMethod | BindingFlags.Instance | BindingFlags.Public );
method.Invoke(classInstance, new object[0]);
}
}
}

Am I going down the wrong road? The class seems to be created without exception, but the created instance doesn't seem to be bound properly as I don't see any of the methods I'm looking for when I loop through!!

-Ray
GeneralVisual inheritance problem Pin
Member 164882919-Jul-05 5:35
Member 164882919-Jul-05 5:35 
GeneralRe: Visual inheritance problem Pin
Christian Graus19-Jul-05 10:56
protectorChristian Graus19-Jul-05 10:56 
GeneralRe: Visual inheritance problem Pin
Dan Neely19-Jul-05 11:06
Dan Neely19-Jul-05 11:06 
GeneralRe: Visual inheritance problem Pin
Christian Graus19-Jul-05 11:10
protectorChristian Graus19-Jul-05 11:10 
GeneralAlphanumeric counter Pin
Zeppelin2519-Jul-05 5:12
Zeppelin2519-Jul-05 5:12 
GeneralRe: Alphanumeric counter Pin
Christian Graus19-Jul-05 10:57
protectorChristian Graus19-Jul-05 10:57 
Generalwebrequest problem Pin
cakewalkr719-Jul-05 4:59
cakewalkr719-Jul-05 4:59 
GeneralRe: webrequest problem Pin
cakewalkr719-Jul-05 5:55
cakewalkr719-Jul-05 5:55 
Questionhow to raise sql messages in c# Pin
fady_sayegh19-Jul-05 4:58
fady_sayegh19-Jul-05 4:58 
AnswerRe: how to raise sql messages in c# Pin
Not Active19-Jul-05 5:57
mentorNot Active19-Jul-05 5:57 
GeneralExcel automation Pin
Christer Claesson19-Jul-05 4:37
Christer Claesson19-Jul-05 4:37 
GeneralProblem with a dynamically loaded DLL Pin
chrismetcalf19-Jul-05 4:00
chrismetcalf19-Jul-05 4:00 
GeneralCOM Events with C# Pin
skai00719-Jul-05 3:31
skai00719-Jul-05 3:31 
GeneralControl Level Transparency Pin
Jaswinder Singh Kohli19-Jul-05 3:12
sussJaswinder Singh Kohli19-Jul-05 3:12 
GeneralRe: Control Level Transparency Pin
Roger Alsing19-Jul-05 3:35
Roger Alsing19-Jul-05 3:35 
GeneralUpdate Row Pin
zaboboa19-Jul-05 2:53
zaboboa19-Jul-05 2:53 
GeneralRe: Update Row Pin
Luis Alonso Ramos19-Jul-05 17:38
Luis Alonso Ramos19-Jul-05 17:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.