Page 1 of 1

PostPosted: Fri Apr 20, 2001 4:08 pm
by Karsten
Hi Kevin,

thanks for your answer to my activex questions.



I want to write some wrappers for missing functions in pocketc.

First I plan to implement the unsupported controls.

That's why I have try your dll-example.

It's so easy - but there is a problem. The control doesn't works right.

Here are the snippets.

-----------------------------------------------------------------------------------------------

vc6-dll-code for the status-bar:

FUNC_DEFINE(sb_Create)

ret.SetVal((int) CreateStatusWindow(WS_VISIBLE|WS_CHILD, L"", (HWND) arrayArg[0].iVal, arrayArg[1].iVal));

FUNC_END

-----------------------------------------------------------------------------------------------

pocketc-code:

#export pcLibrary(1) sb_Create(int,int);

hsb = sb_Create(gethwnd(1), 100));

-----------------------------------------------------------------------------------------------

If I stop the program with a messagebox after the sb_Create-function - the status-bar appear.

But after that there is no refresh.



I hope you understand me. My english is not good.




A nice weekend !

Karsten from Germany

PostPosted: Fri Apr 20, 2001 4:41 pm
by cao
I know your problem, it happened to me as well. :-)
PocketC App is running one thread, the main window is in another thread.
When I create a window, I send a message to the main window to get the window created.
Let me create an example for you.

I have a window structure that can be passed to the main window handler in the main thread.

It will be look like this,

// Fill in the window structure
name =
flag =
...

// send it to main thread, so it will be created there.
sendmessage(mainwindow, PKCMSG_CreateWindow, winstruct,0);

when the main window receives this message, it will create the window in the main thread.
This is how i do it in pocketc runtime.

Let me add that example into the demodll.

Thanks.



<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
Hi Kevin,

thanks for your answer to my activex questions.



I want to write some wrappers for missing functions in pocketc.

First I plan to implement the unsupported controls.

That's why I have try your dll-example.

It's so easy - but there is a problem. The control doesn't works right.

Here are the snippets.

-----------------------------------------------------------------------------------------------

vc6-dll-code for the status-bar:

FUNC_DEFINE(sb_Create)

ret.SetVal((int) CreateStatusWindow(WS_VISIBLE|WS_CHILD, L"", (HWND) arrayArg[0].iVal, arrayArg[1].iVal));

FUNC_END

-----------------------------------------------------------------------------------------------

pocketc-code:

#export pcLibrary(1) sb_Create(int,int);

hsb = sb_Create(gethwnd(1), 100));

-----------------------------------------------------------------------------------------------

If I stop the program with a messagebox after the sb_Create-function - the status-bar appear.

But after that there is no refresh.



I hope you understand me. My english is not good.




A nice weekend !

Karsten from Germany


<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

PostPosted: Sat Apr 21, 2001 5:15 am
by cao
<font face=Courier New>
Added a function to show how to create window properly.
We have to do it this way since there are two threads. The dll function is called in the worker thread, and the window needs to be created in the UI thread.

Download http://pocketc.net/release/30/externdll.zip

</font id=Courier New>

PostPosted: Sat Apr 21, 2001 6:52 am
by Karsten
Thank you !