473,386 Members | 1,621 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Creating and Showing a Form from a Callback Function

I have a callback function that executes when my USB
device is plugged in. I want to create and show a Windows
form when this happens. For some reason, I am not able to
do this. When I try, the form is all white, and I see an
hour-glass cursor.
If I create and show the form from a push-button click
event, it works with no problem.
Any idea why I can't do this?
Thanks,
Dennis
Nov 16 '05 #1
1 1661
Look into marshalling and invoking. Someone could probably give you code on
this, but the idea is that your callback is running in a different thread
than your UI and you need to invoke the UI thread to display the form from
there.

"db_from_mn" <an*******@discussions.microsoft.com> wrote in message
news:15*****************************@phx.gbl...
I have a callback function that executes when my USB
device is plugged in. I want to create and show a Windows
form when this happens. For some reason, I am not able to
do this. When I try, the form is all white, and I see an
hour-glass cursor.
If I create and show the form from a push-button click
event, it works with no problem.
Any idea why I can't do this?
Thanks,
Dennis

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Eric Entressangle | last post by:
Hi all, is there any trouble setting an C++ static class method as callback function for a C program or library ? Thanks
3
by: PengYu.UT | last post by:
Hi, Would you tell me what callback function is used? Why we need it? I searched the web. But most webpages only mention that how to use it but not why to use it. Best wishes, Peng
2
by: db_from_mn | last post by:
I have a callback function that executes when my USB device is plugged in. I want to create and show a Windows form when this happens. For some reason, I am not able to do this. When I try, the...
4
by: H.B. | last post by:
Hi, I successfully implement a static callback function for my dll usign delegates. Now, I need to use member function instead of static function. How can I make that (in Managed C++). Hugo
10
by: Janus | last post by:
Hi, Is there a way to pass arguments to the callback function used inside an addEventListener? I see that I can only list the name of the callback function. For eg, I use this: var...
11
by: The Frog | last post by:
Hi all, Maybe I am just missing something simple here, but I seem to have an issue with a callback function in A97 that is used to fill a Listbox with values. The first time the callback...
6
by: =?Utf-8?B?TWlrZVo=?= | last post by:
I have a thread that parser video-frame from network streaming. It can get up to 1000 frame/second. I want another thread to process video-frame. I can use RaiseEvent or Callback Function. My...
40
by: Angus | last post by:
Hello I am writing a library which will write data to a user defined callback function. The function the user of my library will supply is: int (*callbackfunction)(const char*); In my...
8
by: George Allen | last post by:
So, I have two comboboxes on my form. One has a vlaue list (A), then other uses a callback function to populate (B) items based on the combo A selection. If I select something in A, then the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.