|
Did you marshal the interface to the worker thread?
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
Well here is the deal. I pass pointer to worker thread of Control Class so they can communicate. Everything works fine untill I call the COntrols public Function to call Private Event firing function and there I get Access violation and VS shows me assembler code. I am using MFC not ATL. I just want my each thread to be able to fire event telling the container that it just sent an email. SO in your opinion what should I do to make things go right. Thanks in advance
In my dream, I was dorwning my §orrow§
But my §orrow§, they learned to §wim
|
|
|
|
|
What are you using to fire an event? There are several ways to communicate between worker threads and your main thread.
Todd Smith
CPUA 0x007 ... shaken not stirred
|
|
|
|
|
I am simply giving each thread a pointer to my Control class. The point is it works fine every way except when I call Control's Public function to call its private function to fire event. The problem is there. ACCESS VIOLATION. I am using MFC. What do you suggest me to do. THis is the code in ThreadProc
pCtl->MailSent();
// and this is thee function MAilSent in Control class
void CSMTPControl::MailSent()
{
FireMailSent(); // This is where it gives access violation
}
//////////////////////
as it is an OCX so I cant use Timer in it otherwise I'll set a volatile global variable and will set timer in main thread to firevent when volatile vairblae asks. But I want something else to do to solve it. cuz it is an OCX i cant just send messages to it beacause it is invisible at run time.
In my dream, I was dorwning my §orrow§
But my §orrow§, they learned to §wim
|
|
|
|
|
Hi Todd,
Could you give any references to this kind of thing. I'm having touble as well, but from ATL.
Call a COM method, start a worker thread, and return. Worker thread fires a connection point event.
Thanks,
Giles
|
|
|
|
|
While I don't have an answer, let me know how you get on, as i had the same problem when looking at something similar last week.
Mine was with ATL though. I had implemented a connection point in an object, and wanted to be able to start a worker thread from the COM method, so it could return asyncronously. The worker thread would then fire the event before terminating.
Giles
|
|
|
|
|
What is threading model?
soptest
|
|
|
|
|
I used MFC app wizard so i dont know which one is it. But I guess its STA.
In my dream, I was dorwning my §orrow§
But my §orrow§, they learned to §wim
|
|
|
|
|
You must marshal interface pointer of that control.
soptest
|
|
|
|
|
I dont know what you mean. But do you mean i should use CoMarshalInterface. But this is a headache isnt there any simple way.Thanx for your help anyway.
In my dream, I was dorwning my §orrow§
But my §orrow§, they learned to §wim
|
|
|
|
|
How can i convrt my MFC activeX into MTA model instead of STA.
In my dream, I was dorwning my §orrow§
But my §orrow§, they learned to §wim
|
|
|
|
|
A can not help you with MFC.
Just Create ATL project and copy your implementation to ATL control
soptest
|
|
|
|
|
Hi all,
how do I create a new text-based file with a longname like testdata_12099.<somemorenumbers>?
TIA.
#define MOSTLY_LEAN_AND_MEAN
|
|
|
|
|
What's stopping you???
You can use any file creation mechanism MFC/SDK/.NET to do this.
Nish
Has anyone seen my sig?
|
|
|
|
|
very silly!!(I know) the thing was that I used CFile and CStdioFile at first and Open(mylongfilename) was not working. Have had better luck with CreateFile using UNC format, the way it's supposed to be....right?.
#define MOSTLY_LEAN_AND_MEAN
|
|
|
|
|
Amit Dey wrote:
very silly!!(I know) the thing was that I used CFile and CStdioFile at first and Open(mylongfilename) was not working. Have had better luck with CreateFile using UNC format, the way it's supposed to be....right?.
Huh?
I think there is some other problem here
CFile abc("c:\\windows\\desktop\\abc is abc.txt",CFile::modeCreate );
Just tried it on Windows 98 and the file got created nice and proper just as it should on XP or 2K
Nish
Has anyone seen my sig?
|
|
|
|
|
I have question about SetString()
SetString("Mystring",????(what should be as second parametr?));
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
The type of your string, e.g. VT_LPSTR ,VT_BSTR or VT_LPWSTR
Philip Patrick
Web-site: www.saintopatrick.com
"Two beer or not two beer?" Shakesbeer
Need ASP hosting? Check out 123HostNow.com
|
|
|
|
|
Thanks
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
There is CDHTMLDialog class in VC7,and by default class wizard choose it for base class of dialogs.Can anybody tell me whats that?
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
|
Thank you Matt.
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
Thank you Matt.
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
No problem!
- Matt Newman / Anti-Linux Activist
-Sonork ID: 100.11179:BestSnowman
†
|
|
|
|
|
Hello programmers
i'm using a CEditView, and i want to make a ListBox appear on it when i press the F4 key and disappear when i press the ESc key. I can use accelerator keys to do this but the code and knowledge to make a listbox appear at runtime, i don't have. Can someone help me?
i tried to use accelerator key for F4 with a function of mine OnAccKey() with CEditView to create the listbox but gets a ASSERT error.
Function used
CListBox list;list.AddString("Bernard");list.SetWindowPos(&wndTopMost,10,10,20,20,SWP_SHOWWINDOW);
From Bernard Racoute
Bracoute
|
|
|
|