|
The variable name of my edit box. Its category is value and its variable type is CString.
|
|
|
|
|
Uuuuhhhh
What's this ???
CWinThread* pComPort;<br />
CSP_AsyncRead_2Dlg *pWnd = ((CSP_AsyncRead_2Dlg*) pComPort);<br />
<br />
...<br />
...<br />
<br />
pWnd->m_Vreaddata.SetAt(counter++,*tmp); <br />
What are you trying to do there ??? You have an unitialized CWinThread pointer that is converted to a CSP_AsyncRead_2Dlg pointer and after that you call a function from this 'pointer'
First, you cannot convert a CWinThread pointer into a CSP_AsyncRead_2Dlg (they are completely different things) and second your pointer points to unitilazed memory (it hasn't been initialized) and so you cannot use it before make it points to a valid object.
|
|
|
|
|
So, how should I change my program? Could you write the correct parts that must be changed in my program?
Gratefully thank you for your help.
|
|
|
|
|
If your CSP_AsyncRead_2Dlg* class is the main window of your program and if you use the MFC, you can use AfxGetMainWindow to retrieve a pointer to the main window (then you'll have to cast it to CSP_AsyncRead_2Dlg*).
I also strongly suggest you to get rid of global variables and global functions, preferably make them members of some class.
|
|
|
|
|
What is the message generated when some one a website is about to be loaded or is loading ?
|
|
|
|
|
Opening page...3 items remaining... downloading...
Js for fun
V
|
|
|
|
|
Anonymous wrote:
website is about to be loaded
If you are using CHTMLView then look for thsi message CHtmlView::OnProgressChange
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Use BeforeNavigate2 for a WebBrowser Control.
Marc Soleda.
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
marcdev wrote:
Use BeforeNavigate2 for a WebBrowser Control.
Sorry for correcting you, May be i am wrong too. BeforeNavigate2 fire When WebBrowser start loading the Webpage !
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Ups You're right. I missunderstood the question. Thanks !!
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
marcdev wrote:
I missunderstood the question. Thanks !!
It's Ok
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Does anyone know how to switch the input focus from a console window back to the application window??
I've tried SwitchToThisWindow but it doesn't work.
Is it because i'm calling this in a worker thread function.
UINT MyThreadProc( LPVOID pParam )
{
HWND hwndMain = (AfxGetMainWnd())->GetSafeHwnd();
SwitchToThisWindow(hwndMain, TRUE);
}
|
|
|
|
|
klboy wrote:
how to switch the input focus from a console window back to the application window
What do you mean ? I don't understand your question here. Do you have two separate apps (one a console application and the other a windows application) and inside the console application, you want to set the focus to the other application (that is the window app) ?
If yes, you will need to get the handle with FindWindow function.
|
|
|
|
|
cedric moonen wrote:
What do you mean ? I don't understand your question here. Do you have two separate apps (one a console application and the other a windows application) and inside the console application, you want to set the focus to the other application (that is the window app) ?
If yes, you will need to get the handle with FindWindow function.
No i only have one MFC application.
In the my application i have a DLL statically loaded from which i call a function to invoke a debugging console window.
My application communicates to this console window via tcp.
The console acts is the server and my application acts a client.
Now i want to be able to switch to my main application window where i can pressed a key and send a corresponding debug command to the console window.
But atm as soon as i invoke the console window and establish a server-client connection i can't switch back to the my app window.
The console seems to be waiting to receive some data from my application.
I need to switch to the application so that i can press a key for the client to send a debug command to the console.
|
|
|
|
|
Hi!
I use VC++.NET 2003.
I want to compress following text string.
I store following text in std::string.
std::string
a="2B3A2BF0BCD8773D23BEE5550A56E86AF6CF64911214862625027CE7032451282E33F0BFB09D69091D39B1A1788E1A707E50A1948038500CF2044163F379912AD8B59848C7670C94B29B54D2379E2E7AD8B59848C7670C94B29B54D2379E2E7AD8B59848C7670C94B29B54D2379E2E7AD8B59848C7670C94B29B54D2379E2E7AD8B59848C7670C94B29B54D2379E2E7AD8B59848C7670C94B29B54D2379E2E7AD8B59848C7670C94B29B54D2379E2E7AD8B59848C7670C94B29B54D2379E2E7AD8B59848C7670C94B29B54D2379E2E7AD8B59848C7670C94B29B54D2379E2E7AD8B59848C7670C94B29B54D2379E2E7AD8B59848C7670C94B29B54D2379E2E7AD8B59848C7670C94B29B54D2379E2E7AD8B59848C7670C94B29B54D2379E2E7AD8B59848C7670C94B29B54D2379E2E7AD8B59848C7670C94B29B54D2379E2E7A";
I need to compress above string before transferring it from my server.
How do I compress above string into a compressed string (for example,
std::string b;).
Any help will be appreciated
|
|
|
|
|
|
Hi
I want to automate powerpoint presentation into my MFC Dilogue based application. Let me clear it that I don't want whole Power Point but I want to show presentation files directly into my dialogue. Before this also I have requested help here but didn't get satisfactory answer....
Yes I got one or two code which shows how to load power point from my dialogue based application, but it loads power point as seperate application which normally starts when we start it from Start-> Programm -> Microsoft Power Point. Instead i want to show whole power point into my own dialogue of MFC application.
Any example, likn, idea ....
Thanking you guys...
Amarelia Maehsh
Gujarat
India
-- modified at 6:45 Friday 2nd September, 2005
|
|
|
|
|
that day itself i answered with OLE.
anyway see if this is useful for u..
Click Here^
Regards,
V
|
|
|
|
|
Hi there, I am using Visual C++ ( 2003 IDE ) and I need to have 2 classes which points to each other. ( The need to be able to call Functions on each other !!!!!
It works fine from mb->ma but when I call mb from ma I get an error : "Use of undefined Typ" or similiar
Can someone help me. Just need to have 2 Classes being able to call funtions on each other...
<br />
class mb;<br />
<br />
class ma<br />
{<br />
friend class mb;<br />
public:<br />
ma();<br />
int ausgabe;<br />
int mein(void);<br />
int Callb(void);<br />
void SetParent(mb *aptrb);<br />
protected:<br />
mb *_ptrb;<br />
};<br />
int ma::Callb()<br />
{<br />
int lreturn = 0;<br />
mb *lptr = _ptrb;<br />
return lreturn;<br />
}<br />
void ma::SetParent(mb *aptrb)<br />
{<br />
_ptrb = aptrb;<br />
}<br />
ma::ma()<br />
{<br />
int a = 2;<br />
}<br />
int ma::mein()<br />
{<br />
return ausgabe;<br />
}<br />
class mb<br />
{<br />
public:<br />
mb();<br />
~mb();<br />
void tuewas(void);<br />
int richtig(void);<br />
void SetParent(ma *aptra);<br />
protected:<br />
ma *ptra;<br />
};<br />
int mb::richtig()<br />
{<br />
return 500;<br />
}<br />
void mb::SetParent(ma *aptra)<br />
{<br />
ptra = aptra;<br />
}<br />
mb::mb()<br />
{<br />
int a = 2;<br />
}<br />
mb::~mb()<br />
{<br />
int b = 2;<br />
}<br />
void mb::tuewas()<br />
{<br />
int a = 2;<br />
ma *p = ptra;<br />
if ( p != 0 )<br />
{<br />
a = p->mein();<br />
a = a + 3;<br />
p->Callb();<br />
<br />
}<br />
}<br />
|
|
|
|
|
In the .h files of the mb file, add
class ma;
at the begining of the file.
Then in the .cpp file, include the header of this file.
|
|
|
|
|
I alread did that !!
class B;
class A
{
call something on B --- Wont Work
}
class B
{
Call something on A --- Works
}
|
|
|
|
|
You mean everything is in one single file ?? All the functions and everything are in the header file ?
It is better to separate the implementations of the class functions in the .cpp file. If you put that in the header file, when you call something from B in the class A, the compiler only knows that the class exists, but it doesn't know what are the members of the class B. So, put all the definitions of the functions (from classA and class B) in a separate .cpp file. And this is much cleaner that having everything in the same file.
|
|
|
|
|
First of all Thank you very mich Cedric for the quick response....
I already had them in seperate .h and .cpp files but the error in Visual studio was the same....
It seems that Visual Studio is having a problem when I call mb from ma ( *p == p->Foo() ) than the Compile is telling me that I don't have a valid type ???
Thanks
Marcus
|
|
|
|
|
Ok, so if you have forward declaration and all the function defined in a separate .cpp file, this should work (make sure that the header file of class B is included in the .cpp file of class A and the same for class B).
Now, I think this is not due to that fact but probably a syntax error or something like that. It would be really usefull if you post the exact error message (with the error line and everything) and if you could post also the line which gave this error.
Fehma wrote:
*p == p->Foo()
This looks strange to me...
|
|
|
|
|
Thanks I will try it......
With
<*p == p->Foo() > I meant
p->Foo() // Pointer to Object B calls a Function "Foo" on the Object....
|
|
|
|