DLLCC

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

DLLCC

David Lynch-3
hello,

actually, i want to invoke a C function from Smalltalk that accepts "-v" as the input parameter...

the function prototype in C is "int main (int argc, char **argv)"...

i'm calling this function from Smalltalk as:

InterfaceApplication new dec: 1 with: ''

i dont know how can i pass -v parameter from Smalltalk to the C function ....any ideas????

where the method is declared as follows:

dec: argc with: argv
    <C: int main(int argc, char * * argv)>
    ^self  externalAccessFailedWith: _errorCode


thanks/regards
David
Reply | Threaded
Open this post in threaded view
|

AW: DLLCC

Georg Heeg

David,

 

I do not assume that your function main() compiles and links into a dll. I rather assume that it compiles into an executable (.exe) instead. To call such an executable from Smalltalk DLLCC is not the appropriate interface technology.

 

ExternalProcess defaultClass cshOne: ‘yourProgram.exe –v’ might do it.

 

Georg

 

Georg Heeg eK, Dortmund und Köthen, HR Dortmund A 12812

Tel. +49-3496-214328, Fax +49-3496-214712


Von: David Lynch [mailto:[hidden email]]
Gesendet: Montag, 6. August 2007 21:46
An: [hidden email]
Betreff: DLLCC

 

hello,

actually, i want to invoke a C function from Smalltalk that accepts "-v" as the input parameter...

the function prototype in C is "int main (int argc, char **argv)"...

i'm calling this function from Smalltalk as:

InterfaceApplication new dec: 1 with: ''

i dont know how can i pass -v parameter from Smalltalk to the C function ....any ideas????

where the method is declared as follows:

dec: argc with: argv
    <C: int main(int argc, char * * argv)>
    ^self  externalAccessFailedWith: _errorCode


thanks/regards
David

Reply | Threaded
Open this post in threaded view
|

How to use ICD's in Jun?

Henrik Sperre Johansen
Today, I thought I'd try something new, and write a couple of interfaces
to exploit GL extensions created since version 1.1 shipped with windows
(which is what Jun supports).

When running an example (JunOpenGLInterface example1 to be specific),
checking the gl extensions available using (interface glGetString:
interface GL_EXTENSIONS) only a few came up though, and a quick check of
VENDOR (Microsoft) and VERSION ( 1.1.0) revealed it wasn't using the ICD
of the gfx-card manufacturer...

At first, I tried adding nvoglnt.dll (my ICD) to the "libraryFiles" of
JunWglInterface and running JunOpenGLResource installInterface again.
This did not work though, and after searching the net a bit, I ran into
the PIXELFORMATDESCRIPTOR struct, and how enabling the
PFD_GENERIC_FORMAT flag could disable hardware acceleration.
The JunWglWindowHandle which is used in example1 doesn't enable that
though, but stepping through its initializeFor: method , I finally
noticed the "OpenGLInterface ChoosePixelFormat: deviceContextHandle
with: pixFormatDesc" does...

I ran other tests as well ( after setting JunWglDIBHandle playForSafety
to false ), but all seemed to exhibit this behaviour.

Which, if I have read the MSDN documentation on ChoosePixelFormat
correctly, means the deviceContext (which in the example1 case is a
pointer to a normal applicationwindow) doesn't support hardware
acceleration, and thus reverts it to software.
My question is: Why doesn't it? And more importantly, does anyone know
how to make it work? ;)

Sorry for the long story, and thanks in advance for any advice!