|
i see many web pages with edit controls which allow people to input their bank ID (credit card ID or whatever) and order goods on line.
i try to type a random id (with right numbers) and get a responding like "id is not correct".
i am wandering how these pages know it is not correct?
i think if i input my real id (never try), the pages will know it is right.
my question is: do the pages contact to banks (or whatever) immediately to check the inputting? otherwise how do they know at once?
(i know c++, applet, php, socket etc tech)
thx
includeh10
|
|
|
|
|
See this algorithm[^].
/ravi
Let's put "civil" back into "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
ur page is quite interesting, thx
includeh10
|
|
|
|
|
Hello,
I keep running in to this bug because I don't really know when the appropriate time is to access various child/control windows in the creation of a dialog. I wish to set some of the controls' initial values (e.g., CMonthCalCtrl::SetDayState) once when the dialog is created and before the user sees the child windows.
I have tried to insert such function calls in "OnCreate" or "PreCreateWindow", but these seem to fail. I would like to find the windows message I can use to call such initialization functions that satisfies ASSERT(::IsWindow(m_hWnd)).
Thanks!
JennyP
|
|
|
|
|
If it's a modal dialog, you can manipulate the controls in OnInitDialog() . If it's a modeless dialog, do it after the dialog has been shown for the first time.
I put my GUI initialization code for modeless dialogs in a method called initGUI() that I call once in OnShowWindow() when the window is being shown.
/ravi
Let's put "civil" back into "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
how can u access the child control properties even before the parent window is created..?? that is the reason that fails...
Renjith-CPian.
|
|
|
|
|
Hi Guys,
I am writing a Monitoring/Alert application using Winsock.
I have a dialog based application.
The Server part accepts incoming client connections and sends alert messages to clients when certain things happen.
I have a main dialog which shows monitoring results.
I have a CSocketManager class which manages all the Winsock stuff.
In my main dialog class I have declared a member variable of type CSocketManager m_SocketManager.
I have created a second dialog which will be interface to manage all Winsock comm stuff, start server listening,port, messages from clients etc.
The reason I am not creating CSocketManager object in the class for this dialog is that I want Socket object to exist and remain listening even after this second dialog is closed.
This second dialog is just an interface that the user can access from menu on main dialog when the need arises to for example see what clients are connected or to send a message to all clients.
Ho to I refer to the CSocketManager object m_SocketManager declared in the main dialog class in the class for this second dialog.
...or is there another way I should be structuring everything or another way to do things.
To try and summarize what I am trying to achieve is I want to create a Socket object which I can reference and manipulate from a second dialog but I do not want this Socket object to be destroyed when this second dialog is closed.
I am fairly new to C++.
I appreciate that this is a fairly general and possibly wide ranging question but any ideas would be appreciated.
Let me know if I can more specific about any point or if anything is unclear in my question.
Cheers
Zed's dead, baby. Zed's dead.
|
|
|
|
|
Just pass the address of m_SocketManager to a member in the 2nd dialog, before you call its DoModal() . The 2nd dialog can then manipulate the object from within itself.
/ravi
Let's put "civil" back into "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Ravi,
Thanks very much for your feedback.
I am a bit new to all of this so could you please give a simple example of how to pass address of m_SocketManager to member variable in 2nd dialog class.
What is the most professional way to pass this address??
Cheers
Zed's dead, baby. Zed's dead.
|
|
|
|
|
The easiest way to do this is to declare a public member pointer to a CSocketManager object in dialog 2, like so:
CDialogTwo : public CDialog
{
...
public:
CSocketManager* m_pSocketManager;
} Then, in the first dialog, set that member before displaying the 2nd dialog, like so:
CDialog2 dlg2 (this);
dlg2.m_pSocketManager-> &socketManager;
long nStatus = nDlg2.DoModal();
...
/ravi
Let's put "civil" back into "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
just make the CSocketManager as ur main dialog's public member variable..and Create the new Dialog as child and
you can access the CSocket_manager obbject from ur child dialog like
GetParent()->CSocket_managerObject;
Renjith-CPian.
|
|
|
|
|
You'd first need to cast the CWnd* returned by GetParent() .
/ravi
Let's put "civil" back into "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Renjith,
Thank you very much for your feedback.
In a dialog-based application how can you indicate that you want a second dialog to be child of the first dialog?
Cheers;)
Zed's dead, baby. Zed's dead.
|
|
|
|
|
hi,
i'm currently make a simple add-in which work on the project files but i was surprised to see that there is no way to get those file names through the IGenericProject interface It seems to me that it's the _logical_ place where you should find this kind of info.
Here is some text from msdn lib for vc 6.0 : "The Project object represents a group of related files that can include one or more configurations.". unfortunately, as i said before, i didn't the methods to get those 'related files' names (something like GetFilesCount and GetFileById).
if you have any hint i would appreciate. pfffff, i will never get the way microsoft design their software
|
|
|
|
|
so, no one can help on this topic ??
|
|
|
|
|
Do you want to see something really stupid...
Something like... Hey ! There is a reply for your post but you have to see all this banners or you won't get NOTHING !!! ( mmm... what about the volunteer that makes the answer did the pay him ? ):
(...)
This thread is located at:
http:
There may be other replies also, but you will not receive any more notifications until you visit the board again.
Yours,
CodeGuru Forums team
Are this people idiots ???, I think at least they are not programmers, marketing monkeys or something like that... they suck !
|
|
|
|
|
|
I currently have a docked dialog bar with a tree control in it. The parent App has various functions which I want to use to populate the tree when I click on a tree item. I'm having trouble figuring out how to access the parent functions and variables from the docked dialog window.
Can somebody help?
BW
{insert witty/thought-provoking saying here}
|
|
|
|
|
You can SendMessage to the parent and then have it do what you want it to. That would not be the same as the child window accessing the parent's functionailty.
Alternatively, you could pass the childwindow a pointer to the parent when you create the child.
Though you must be careful in how you design this. If not done well you can end up with spaghetti code.
|
|
|
|
|
When I run a testing script. I got the error:
Microsoft VBScript compilation error [Line ] Expected end of statement
Dim doc As Integer
"Dim doc As Integer" is the script I passed it. The script is quite simple, and why does it have compilation error ?
I called MyScriptSite's ParseScript to run the script. Below is the code. I chased before calling ParseScript, the state is Initialized.
<br />
STDMETHODIMP CMyScriptSite::ParseScript(BSTR bstrText)<br />
{<br />
<pre><br />
EXCEPINFO exception;<br />
ZeroMemory(&exception, sizeof(exception));<br />
<br />
SCRIPTSTATE pst;<br />
m_pScript->GetScriptState(&pst);<br />
<br />
m_pScriptParse->ParseScriptText(bstrText, 0, 0, 0, 0, 0,<br />
SCRIPTTEXT_ISPERSISTENT|SCRIPTTEXT_ISVISIBLE, 0, &exception);<br />
<br />
return S_OK;<br />
</pre><br />
}<br />
|
|
|
|
|
That's because VBScript only has one type.... The variant.
Try this:
dim doc
...
...
That should take care of your problem.
|
|
|
|
|
Thanks, now it can successfully call ParseScriptText, but after it, when i called SetScriptState(SCRIPTSTATE_CONNECTED), it raised an ASSERT failed error. Do you know why ?
|
|
|
|
|
I need to call a console application with command line arguments, and send the output to a file. I could also make use of this by sending the output to my "parent" stdin, but I thought that would be more difficult.
I use CreateProcess using NULL for the appName, and put everything into the cmdLine param. Something like
"C:\junk\g7a.exe" t "C:\junk\file1.tgz" * > testfile.txt
The programs seems to run, but never creates the testfile.txt. If I copy, and paste the same string into the Start->Run window, it does not create the file either. If I copy, and paste into a DOS prompt window, it works fine.
Do I need to do something with the handles, or am I missing something?
Thanks,
David
|
|
|
|
|
This article[^] may help.
/ravi
Let's put "civil" back into "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Thank you. It's exactly what I needed.
|
|
|
|