|
Try to ask this question in the web development forum! Here most people don't know or know to little about webdev to answer you unclear question. Even if someone knows it, I doubt that he / she will answer.
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
dex_ter11 wrote:
I tried to use POST to send string to a text box in the website.
are using Visual C++ post data or some other Language
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
sorry for the unclear information. What should i do, to send a string to a text box of a html page using visual C++?
thanx
|
|
|
|
|
Then you have to get the Current Object of the INTEREXPLORE WINDOW i.e. IWebBrowser control.
using IWebBrowser control you can retrieve whole HTML page present in the BROWSER, Remember Browser can only display the HTML pages, .ASP are just HTML PAGES developed at Runtime by Server.
Now IWebrowser::get_Document() retrieve IHtmlDocument2 interface and manaully parse the HTML page to reach your INPUT box and put you value into it.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
I searched for my problem and found other who had it, but didn't find an answer.
I am getting "LNK2001: unresolved External Symbol" in my MFC Dialog Box Program. Here is my situation:
The unresolved symbol is a CString that belongs to my Edit Control. It is declared as a Public variable in my main dialog class in "dialog1.h". Now this is being used within a static member function (in the same class) which is declared in "dialog1.h" (The function is a Seperate Thread being called by AfxBeginThread() from "dialog1.cpp". The actually Function however is in "dialog2.cpp". The CString is being used within this function in "dialog2.cpp". Both "dialog1.cpp" and "dialog2.cpp" have includes for "dialog1.h", so I do not see the reason why this is happening.
I thought of making this CString external, but I am not sure how to do it when it is a member of a class.
Rundown:
CString Variable: Declared in dialog1.h and initialized in dialog2.cpp
static member function: declared in dialog1.h and initialized in dialog2.cpp
Static member function is called from dialog1.cpp using AfxBeginThread() API.
If anyone has any suggesstions that would be great.
|
|
|
|
|
you can not access non-static members of a class within a static function.
you can only access that member through an instance of the class passed as a parameter for example.
Greetings,
Davy
|
|
|
|
|
So if I understand correctly, you have a static CString member variable in your edit control, which is the unresolved external symbol right?
If this is the case, your code of your edit control should look like this:
class CMyEditCtrl : public CEdit
{
public:
static CString st_sSomeString;
};
if this is the case, your problem is that you didn't declare the static variable. In MyEditCtrl.cpp, add the declaration like this:
CString CMyEditCtrl::st_sSomeString = "";
That should resolve your problem. If the above is not your case, try to clearify your problem, by posting some code snippets..
Hope this helps
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Thank You Bob, This did solve my problem
However, now I am not getting output to my edit box. Here is what I am doing:
static CString mystring;
CProgressCtrl m_sigstr;
UINT getstring[4];
m_string.Format("%d",getstring[1]); // Format m_string with a decimal Number
static UpdateData(FALSE); // Send New string to Edit Box
m_sigstr.SetPos( getstring[1] ); // Set Position of Progress Bar according to getstring value
getstring [1] both holds the value I want to output to the edit box and use to reposition the progress bar. From a debug I did, it is not working on the progress bar as well as not outputting the value to the Edit Box.
|
|
|
|
|
CNewbie wrote:
m_string.Format("%d",getstring[1]);
static UpdateData(FALSE);
m_sigstr.SetPos( getstring[1] );
Consider that code fragment. I thought about the following things the moment I say it:
<list>What is that static word doing there?
Why do you call UpdateData(FALSE); in the middle of your updating process?
If you look up the UpdateData() function in MSDN, you see that this calls DoDataExchange() which synchronizes the data of all the controls on your dialog. Knowing this, you should move the call to UpdataData(FALSE) down the bottom of the function. After this, all the changes will be made visible.
Hope this helps
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Thanks for responding. I understand your logic, but the reason why I cannot do that is because that function loops over and over again every 500ms until a condition is met and then it exits. The Edit control as well as the progress bar will update at the bottom of every iteration. So you see if I put the UpdateData() at the end of the function, the edit box would never update until the function exited and that would defeat the whole purpose of what I want to do here.
|
|
|
|
|
Than put the call to UpdateData() after you update the progress bar instead of before it...
Sometimes, a little bit of experimenting will do magic for you...
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Also If I dont put "static" in front of UpdateData(FALSE), I get this error:
error C2352: 'CWnd::UpdateData' : illegal call of non-static member function
|
|
|
|
|
I've never seen that before... It doesn't seem like legal C++ to me, but if the compiler accepts it, I must be wrong...
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Are you attempting to update a control on the dialog from another thread? If so, this is extremely dangerous and not recommended.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Thank you for the reply David. Do you have any recommendations on how I can go about outputting to the window from within this thread. Basically i want to do the math and output every 500ms.
Thanks
|
|
|
|
|
CNewbie wrote:
Do you have any recommendations on how I can go about outputting to the window from within this thread.
Yes, post a message back to the main thread who is in charge of the UI. See here and here.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Hi
I have this supposedly simple problem.
I need my program to do some complicated calculations in response to some user interaction. While the thing is calculating, usually, it just sits there and doesn't take anymore inputs until it's done. This can take a few seconds. To remind the user that the program is thinking hard, I want to pop up a modeless dialog with messages like "obtaining parameters" and "performing a monstrous calculation".
So,
1) I popup a innocent looking dialog with a "create" and "show".
2) I set its title to whatever calculation it's supposed to be performing at the time.
3) I set the text of the edit box on this dialog to a more detailed description of what's happening inside the program as the calculation progress.
4) When the calculation is done, I put away the dialog.
All except number 3) (which is the important bit!) work. WHY??? I'm using a humble "SetWindowText" function which has worked fine a hundred times in the past! Any ideas what I might have missed? Or any ideas how I can look up this problem on the net?
Cheers
KK
|
|
|
|
|
After the SetWindowText call the UpdateWindow on the dialog..
SetWindowText will place a WM_PAINT in the queue, which is not being accessed due to your murderous calculation taking place in the same thread.
Hope this helps you...
Greets,
Davy
|
|
|
|
|
Wow, magic!
Thanks a lot!
|
|
|
|
|
Are you performing the "monstrous calculation" in a separate thread? If not, you should be. It's a much cleaner approach to what you are doing.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
No, I'm not using different threads. You are right, of course.
Just that, if you have a horse in the way, it might be wise to move it. But if you have an angry elephant in the way, I'd rather walk around it, even if I end up in the bushes...
The problem is, the calculation bits are so tangled up with loads of other stuff, it's a lot of hassle to move them just for the sake of a dialog box. I probably broke all the rules of good programming Getting it wrong now can only make my next project better
Thanks for the thought, anyway.
|
|
|
|
|
Kiriko wrote:
Just that, if you have a horse in the way, it might be wise to move it. But if you have an angry elephant in the way, I'd rather walk around it, even if I end up in the bushes...
Philosophy in a VC++ forum? Interesting...
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Given:
class C {
public:
void f() {};
};
void (C::*pmf)() = &C::f;
C* pC = new C;
pC->*pmf(); // OOps, Error
How to fix such problem? Thanks.
Andrew
|
|
|
|
|
try
(pC->*pmf)();
Greets,
Davy
|
|
|
|
|