[BUG], ruby 1.6.8 (2002-12-24) [i586-mswin32]

hello,

I have an existing DLL which is using the MFC.
I going to wrap this dll in ruby and so I wrote a
new dll.

In the init function of this dll I call…

···


VALUE cRubyVServCli;
void Init_RubyVServCli()
{
Beep(100,100);
Sleep(1500);
cRubyVServCli = rb_define_class(“RubyVServCli”, rb_cObject);
Beep(100,100);
// ruby_define_method(cRubyVServCli, “rPAAbout”, rPAAbout, 0);
}

This certain shows that the rb_define… function throws this
error:

[BUG] Segmentation fault ruby 1.6.8 (2002-12-24) [i586-mswin32]

Is there a way to avoid this?
Where happened this error?

daniel


I’m using VC

  cRubyVServCli = rb_define_class("RubyVServCli", rb_cObject);

Be sure to define IMPORT (perhaps with NT=1) when you compile your
extension, otherwise you can't access rb_cObject

Beep(100,100);
// ruby_define_method(cRubyVServCli, "rPAAbout", rPAAbout, 0);

       ^^^^

  this is rb_define_method()

Guy Decoux

ts wrote:

“d” == daniel student_vienna@aon.at writes:

cRubyVServCli = rb_define_class(“RubyVServCli”, rb_cObject);

Be sure to define IMPORT (perhaps with NT=1) when you compile your
extension, otherwise you can’t access rb_cObject

Beep(100,100);
// ruby_define_method(cRubyVServCli, “rPAAbout”, rPAAbout, 0);
^^^^

this is rb_define_method()

yes, I know this. I’v wrote a fn which mapped the ruby-fn
for c++.

Guy Decoux

hello,

yes, I’v searched for a solution to my problem (internet…) and
also found the the compiler options.
But it does not help!

First I’v wrote a dll without mfc and wrapped only functions
which used not the mfc - and this dll works fine!
Then I’v wrote a dll with mfc and then happened the described errors.
So I think the error comes with the mfc…?

Anyway, I’m very angry with this error!

Hope, someone is able to help me…

@ts:
I can’t send you a email because my smtp say your address
is not reachable. Can you describe me more exactly why this
error occur?

greetings,
daniel

Then I'v wrote a dll with mfc and then happened the described errors.
So I think the error comes with the mfc...?

Well, I know nothing about windows, perhaps you can see with the author of
"Practical Ruby" apparently it use also MFC

    http://gaiacrtn.free.fr/

Guy Decoux