Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / CLR / February 2008

Tip: Looking for answers? Try searching our database.

GenerateCeeMemoryImage / GenerateCeeFile

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
knattetjatte@googlemail.com - 13 Feb 2008 17:17 GMT
Hello group,

I am using the unmanaged API to create assemblies, emitting methods
into it, adding VTableFixup-entries and then saving it to disk. Then I
use the managed methods from unmanaged code, using LoadLibrary/
GetProcAddress, which works fine. Pretty cool.

But..

The next step is to jump the generate-file-on-disk part and use
CeeFileGen's GenerateCeeMemoryImage() instead of saving it to disk and
this is where I am currently having issues.

My old code did GenerateCeeFile() in the end which wrote the HCEEFILE
to disk. I thought that GenerateCeeMemoryImage() could be used as a
replacement but it seems not.. see an excerpt of my code below and the
error message I get:

[ ... code which gets an ICeeFileGen instance and does emit-stuff
removed ... ]

void *p = NULL;
hr = ceefilegen->GenerateCeeMemoryImage(file, (void**)&p);

This fails with 183, "Error Already Exists" which I cannot make sense
out of. The sscli reference code for GenerateCeeMemoryImage() does not
return any such errors..

I would appreciate it if anyone with an insight into these things
could give me a hint or two on how to use the GenerateCeeMemoryImage
function.

/joakim
knattetjatte@googlemail.com - 14 Feb 2008 13:26 GMT
On Feb 13, 6:17 pm, "knattetja...@googlemail.com"
<knattetja...@googlemail.com> wrote:

> void *p = NULL;
> hr = ceefilegen->GenerateCeeMemoryImage(file, (void**)&p);
>
> This fails with 183, "Error Already Exists" which I cannot make sense
> out of. The sscli reference code for GenerateCeeMemoryImage() does not
> return any such errors..

For the archives..

It turns out you cannot set the output file name and then "change your
mind" and do GenerateCeeMemoryImage() so in my case I just had to
remove the call to SetOutputFileName() a bit earlier in the code and
it started working.

/joakim

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.