Click here to Skip to main content
15,886,919 members
Home / Discussions / C#
   

C#

 
GeneralLicense Key Create / Validate for windows Application Pin
wcoods28-Jul-04 0:42
wcoods28-Jul-04 0:42 
GeneralRe: License Key Create / Validate for windows Application Pin
Heath Stewart28-Jul-04 4:39
protectorHeath Stewart28-Jul-04 4:39 
GeneralFinding File names from an Executable Pin
Lee Majors27-Jul-04 23:19
sussLee Majors27-Jul-04 23:19 
GeneralRe: Finding File names from an Executable Pin
Colin Angus Mackay28-Jul-04 0:17
Colin Angus Mackay28-Jul-04 0:17 
GeneralRe: Finding File names from an Executable Pin
Lee C Baker28-Jul-04 0:56
Lee C Baker28-Jul-04 0:56 
GeneralRe: Finding File names from an Executable Pin
Heath Stewart28-Jul-04 4:19
protectorHeath Stewart28-Jul-04 4:19 
GeneralSerializing COM objects Pin
wute527-Jul-04 14:06
wute527-Jul-04 14:06 
GeneralRe: Serializing COM objects Pin
Heath Stewart28-Jul-04 4:27
protectorHeath Stewart28-Jul-04 4:27 
That really depends on what interfaces the COM object implements. If it implements any of the IPersist* interfaces (IPersistFile, IPersistStream, IPersistStreamInit, etc.) then you need to declare those interfaces (the .NET BCLs already declare the IPersistFile and IStream interfaces as UCOMIPersistFile and UCOMIStream, respectively) where the methods are in the right order and the interfaces are attributed with the ComImportAttribute, the GuidAttribute (with the right IID of the interface), and the right InterfaceTypeAttribute (to declare it as an IUnknown, IDispatch, or dual interface).

You cast the COM object in managed code (assuming you have a reference to it in managed code) to one of those interfaces in order for the CLR to do a QueryInterface for that method. Then you call Load, Save, or whatever is appropriate and pass the filename, an IStream implementation, or anything else that is required by the IPersist* interface.

 

Microsoft MVP, Visual C#
My Articles
GeneralAutomatically Display Expire Date Pin
ASGill27-Jul-04 13:54
ASGill27-Jul-04 13:54 
GeneralRe: Automatically Display Expire Date Pin
Colin Angus Mackay28-Jul-04 0:31
Colin Angus Mackay28-Jul-04 0:31 
GeneralRe: Automatically Display Expire Date Pin
ASGill28-Jul-04 7:58
ASGill28-Jul-04 7:58 
GeneralRe: Automatically Display Expire Date Pin
Roman Rodov28-Jul-04 15:50
Roman Rodov28-Jul-04 15:50 
Questiondouble -> float : casting or Convert.ToSingle ? Pin
crushinghellhammer27-Jul-04 13:13
crushinghellhammer27-Jul-04 13:13 
AnswerRe: double -> float : casting or Convert.ToSingle ? Pin
mikker_12327-Jul-04 22:56
mikker_12327-Jul-04 22:56 
AnswerRe: double -> float : casting or Convert.ToSingle ? Pin
Nick Parker28-Jul-04 2:56
protectorNick Parker28-Jul-04 2:56 
GeneralCreating MDB & MDW with ADOX and C# Pin
ulrich_v27-Jul-04 10:49
ulrich_v27-Jul-04 10:49 
GeneralProtocol Violation using HttpWebRequest Pin
Amir Zicherman27-Jul-04 9:50
Amir Zicherman27-Jul-04 9:50 
GeneralRe: Protocol Violation using HttpWebRequest Pin
Nick Parker27-Jul-04 10:35
protectorNick Parker27-Jul-04 10:35 
GeneralRe: Protocol Violation using HttpWebRequest Pin
Amir Zicherman27-Jul-04 14:23
Amir Zicherman27-Jul-04 14:23 
GeneralRe: Protocol Violation using HttpWebRequest Pin
Nick Parker27-Jul-04 18:05
protectorNick Parker27-Jul-04 18:05 
GeneralRe: Protocol Violation using HttpWebRequest Pin
Amir Zicherman27-Jul-04 18:12
Amir Zicherman27-Jul-04 18:12 
GeneralRe: Protocol Violation using HttpWebRequest Pin
Tom Larsen27-Jul-04 18:39
Tom Larsen27-Jul-04 18:39 
GeneralRe: Protocol Violation using HttpWebRequest Pin
Amir Zicherman27-Jul-04 20:26
Amir Zicherman27-Jul-04 20:26 
GeneralComponents, Mouse Events and Abnormal Shapes Pin
Tristan Rhodes27-Jul-04 6:02
Tristan Rhodes27-Jul-04 6:02 
GeneralRe: Components, Mouse Events and Abnormal Shapes Pin
Gary Thom27-Jul-04 7:26
Gary Thom27-Jul-04 7:26 

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.