views:

402

answers:

1

Hi

I want to write a program which runs regasm.exe to create a tlb file programatically.

How can I do this??

Ur help is greatly appreciated...

Thanks in advance.

+3  A: 

You have to use the CreateProcess() function to run the command line like "fullPathToRegasm /somekeys filename".

The main problem is to detect the regasm location - use GetCORSystemDirectory() function for that. First use first LoadLibrary() to load the mscoree.dll, then call GetProcAddress() to locate the GetCORSystemDirectory() function, then call the function.

This will get you the root of .NET installation. regasm is usually located in the same subpath of the installation root on any given machine so you can safely combine the detected root with the subpath and this will be a valid regasm location.

sharptooth
can u give me the sample code snippet plzzzz
Cute
I rather suggest that you start writing it and ask specific questions as you progress.
sharptooth
ok thanks for ur support
Cute