Click here to Skip to main content
16,007,163 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to delete a pointer. Pin
Colin Angus Mackay4-Dec-07 10:10
Colin Angus Mackay4-Dec-07 10:10 
GeneralRe: How to delete a pointer. Pin
daavena4-Dec-07 8:01
daavena4-Dec-07 8:01 
AnswerRe: How to delete a pointer. Pin
PIEBALDconsult4-Dec-07 8:42
mvePIEBALDconsult4-Dec-07 8:42 
GeneralHi I again Pin
wasimsharp4-Dec-07 4:26
wasimsharp4-Dec-07 4:26 
GeneralRe: Hi I again Pin
Luc Pattyn4-Dec-07 5:04
sitebuilderLuc Pattyn4-Dec-07 5:04 
QuestionHow to make viewstate work for inactive textbox? Pin
bochno4-Dec-07 4:07
bochno4-Dec-07 4:07 
GeneralRe: How to make viewstate work for inactive textbox? Pin
bochno4-Dec-07 21:13
bochno4-Dec-07 21:13 
GeneralNullReferanceException when using a callback and Invoke Pin
Member 38482694-Dec-07 3:36
Member 38482694-Dec-07 3:36 
Hello, everyone.

I'm hoping this is the right place to post my question. I've been looking around on the net for the last couple of hours and haven't found a solution to my problem. (I did learned some new stuff for use in the future). So this is my situation. I have a program that lets the user create a response test using a movie. When I tried to draw on the movie the activeX controller always pushed its way to the front. So I've created a separate form that floats on top of the main form to draw on. The program also has three threads running, the main thread, a timing thread, and a thread that updates the floating form.

My problem is when I try and send a message to the floating form I trip a NullReferenceException. I've checked both the callback and my class, and both look properly initialized. The floating form is also correctly intialized. I've tried everything I could find, but nothing helps. I've included the method and the callback declaration. The floating form is called 'TestViewer' and the 'HOTSPOT' class is one I've created.

Thanks everyone for your help.

(Sorry my code is in C++, but I know most people us C# or VB when programming in .net, and a lot more people frequent this form than the managed C++ one. If needed I can translate it into C#. Feel free to give me an answer in C#. Over the years I've gotten pretty good a translating C# to C++. Thanks.)

delegate System::Void SetDrawActivePanelCallback(HOTSPOT^ hSpot);

private: System::Void SetTestViewDrawActivePanel(HOTSPOT^ hSpot)
{
if(this->TestViewer->InvokeRequired)
{
SetDrawActivePanelCallback^ cb = (gcnew SetDrawActivePanelCallback(this,
&Edit::SetTestViewDrawActivePanel));

try
{
this->Invoke(cb, hSpot);

} // End try

catch(System::NullReferenceException^ e)
{
String^ s = e->ToString();
::MessageBox::Show(s);

} // End catch

} // End if

else
{
System::Windows::Forms::Panel^ panel = hSpot->GetPanel();
this->TestViewer->DrawActivePanel(panel, this->hotspotVisible);

} // End else

} // End SetTestViewDrawActivelPanel
GeneralRe: NullReferanceException when using a callback and Invoke Pin
J4amieC4-Dec-07 5:39
J4amieC4-Dec-07 5:39 
QuestionWhat this error ? Pin
E_Gold4-Dec-07 3:05
E_Gold4-Dec-07 3:05 
AnswerRe: What this error ? Pin
Judah Gabriel Himango4-Dec-07 7:52
sponsorJudah Gabriel Himango4-Dec-07 7:52 
GeneralTCP/IP (Server To Server) Pin
half-life4-Dec-07 3:02
half-life4-Dec-07 3:02 
Questioninvalid report file path of crystal Report Pin
infi_20074-Dec-07 2:40
infi_20074-Dec-07 2:40 
GeneralCreating Website in SharePoint using C#/ASP.NET Pin
md Nazeem4-Dec-07 2:32
md Nazeem4-Dec-07 2:32 
GeneralC# Interop problem under Vista Pin
Stevo Z4-Dec-07 2:22
Stevo Z4-Dec-07 2:22 
GeneralHelp on changing color of a listbox item Pin
Kyle Maldonado4-Dec-07 2:12
Kyle Maldonado4-Dec-07 2:12 
QuestionHow to programmatically change the icon of the application .exe Pin
Member 47491754-Dec-07 2:06
Member 47491754-Dec-07 2:06 
AnswerRe: How to programmatically change the icon of the application .exe Pin
PIEBALDconsult4-Dec-07 3:40
mvePIEBALDconsult4-Dec-07 3:40 
GeneralRe: How to programmatically change the icon of the application .exe Pin
Member 47491754-Dec-07 22:12
Member 47491754-Dec-07 22:12 
QuestionHow to start a single instance of application through selected multiple associated files Pin
Lyfkcd4-Dec-07 1:35
Lyfkcd4-Dec-07 1:35 
GeneralRe: How to start a single instance of application through selected multiple associated files Pin
Skippums4-Dec-07 12:03
Skippums4-Dec-07 12:03 
GeneralRe: How to start a single instance of application through selected multiple associated files Pin
Lyfkcd11-Dec-07 5:19
Lyfkcd11-Dec-07 5:19 
Generalmultilingual installation setup and custom program EXE selection in single setup in C# 2.0 (Visual Studio 2005) Pin
Sundarapandian.Balasubramanian4-Dec-07 1:30
Sundarapandian.Balasubramanian4-Dec-07 1:30 
Generalanchor and dock properties Pin
chithra.r4-Dec-07 1:18
chithra.r4-Dec-07 1:18 
GeneralRe: anchor and dock properties Pin
dan!sh 4-Dec-07 5:25
professional dan!sh 4-Dec-07 5:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.