|
Doeas anybody know how I can check an user password whether valid or unvalid?
BOOL checkPassword(CString strUserName, CString strPassword)
thank you very much
|
|
|
|
|
You'll have to use LogonUser for that.
Tomasz Sowinski -- http://www.shooltz.com
To some its a six-pack, to me it's a support group
|
|
|
|
|
In vc++6, we can add an item on the toolbar then go to the class wizard to add message or event handler for that ID, it is very convenient, but when I use vc++.net, I can't find how to add event handler for a toolbar item? why?
victorswan
|
|
|
|
|
The easiest thing to do is to add a menu item with the same ID as the toolbar button, then add a message handler for the menu item.. that way both the toolbar button and the matching menu item call the same thing..
if you want to setup a message handler for the toolbar manually you can just add the following into your message map in your mainfrm.h (or whatever class you want)
ON_COMMAND(ID_MYBTN, OnMyBtn)
then make a class named OnMyBtn() to correspond with the messagemap..
-dz
|
|
|
|
|
What you have said I know, I just want to know why vc++.net lose the simple and perfect function in vc++6?Is there any other ways?
victorswan
|
|
|
|
|
i think the reason is that every toolbar button is supposed to have a menu item associated with it.. everything on every toolbar in every program should have a way of doing the same thing in the menu..
i was origionally frustrated at the same thing.. ah well.
-dz
|
|
|
|
|
Hello!
My problem is this...
I have created a view that has tabs like a property sheet.
My View class is derived from TabbedView a class derived from CCtrlView.
TabbedView class uses dialog resources to define the contents of a page.
Inside a page I create a CRichEditCtrl using the Create member function.
The applications scrollbars are created manually in the
CMainFrame::OnCreate() member function (without using the ES_CENTER or ES_RIGHT styles) and are positioned using the RecalcLayout() member function.
In the CMyView::OnVScroll() handler the contents of the RichEditCtrl are scrolled vertically using the LineScroll member function.
The problem is that when trying to use the LineScroll member function to scroll the contents of the RichEditCtrl horizontally in the
CMyView::OnHScroll() handler nothing happens.
If anybody has a suggestion on what might me wrong he/she is most welcome!
Thanks...
|
|
|
|
|
You need to handle scrolling events in the rich edit's parent - probably it's the page window. The parent gets EN_HSCROLL/EN_VSCROLL notifications. Just don't forget about ENM_SCROLL in SetEventMask call.
Tomasz Sowinski -- http://www.shooltz.com
To some its a six-pack, to me it's a support group
|
|
|
|
|
Thank you for your reply.
However, I want to scroll the contents of the RichEditCtrl through the scrollbars in the FrameWindow and not the scrollbars in the RichEditCtrl
(when for example it is created with the WM_HSCROLL style).
I tried handling the EN_HSCROLL notification but they are issued when a user
tries to scroll using the scrollbar in the RIchEditCtrl and not the Frame window.
Is this what you had in mind????
(I like the six pack moto but right now I could use a bottle of whiskey...)
|
|
|
|
|
Why on Earth do you want to have scrollbars in edit control --and-- in frame window doing the same thing?
Tomasz Sowinski -- http://www.shooltz.com
To some its a six-pack, to me it's a support group
|
|
|
|
|
I don't have scrollbars in the edit control, only in the frame window.
When handling the EN_HSCROLL message nothing happens when a user tries to scroll through the scrollbars in the frame window.
(After that I added scrollbars in the edit control and the EN_HSCROLL handler
worked, but that is not what I want.)
|
|
|
|
|
jabbaj wrote:
(After that I added scrollbars in the edit control and the EN_HSCROLL handler
worked, but that is not what I want.)
It's classic chicken and egg problem. LineScroll will not work, unless you have scrollbars in edit control. And you don't want scrollbars in edit control.
Tomasz Sowinski -- http://www.shooltz.com
To some its a six-pack, to me it's a support group
|
|
|
|
|
In my view class I have a OnVScroll handler.A part of this function is the following...
<br />
<br />
case SB_LINEUP: <br />
{<br />
if (CurPos <= 2*(total_height[pgnm] / lines_edit) - 1 )<br />
{ <br />
re->LineScroll(-1,0);<br />
CurPos =0 ;<br />
EnableScrollBar(SB_VERT, ESB_DISABLE_LTUP);<br />
}<br />
else<br />
{ <br />
re->LineScroll(-1,0);<br />
CurPos -= total_height[pgnm] / lines_edit ;<br />
}<br />
SetScrollPos(SB_VERT, CurPos);<br />
PrevPos = CurPos;<br />
}<br />
break;
This works fine when scrolling vertically!
All the LineScroll function does is scroll the contents of the edit control
1 line up when the user clicks the top arrow of the vertical scrollbar in the Frame window.
When I try to do the same in the OnHScroll handler (respectively e.g. (SB_LINERIGHT)) and try to use the LineScroll function (e.g. re->LineScroll(0,-1)) then nothing happens.
This is my problem.
I do not scrollbars in the edit control because the buttons of the Tab are
on the bottom of the page and the horizontal edit scrollbar appear on top of them (as it should in the first place).
Hope this clears things a bit.
|
|
|
|
|
I am saving a file.On click the save button ,the file starts saving.So i have to show the busy cursor.How can i find out that the file is saved,so that again i change my busy cursorto normal cursor
|
|
|
|
|
Use BeginWaitCursor() and EndWaitCursor()
Best regards,
Eugene Pustovoyt
|
|
|
|
|
The saving routine returns when the file is saved.
Or are you multithreaded, with saving in a different thread?
|
|
|
|
|
If you're using MFC, just declare CWaitCursor local variable. If you're on bare Win32 API, then use LoadCursor/SetCursor.
Tomasz Sowinski -- http://www.shooltz.com
To some its a six-pack, to me it's a support group
|
|
|
|
|
Hi All,
I have an exe file which I need to use in my program.Since the exe is not made by me I need to store the output created by the exe into some text file.Thus to execute this file from my program I'm using this statement into my program:
system("filename.exe parameter>output.txt");
Using a redirection symbol I'm getting the output into the output.txt file as required.What I need is if the executable is unable to produce an output in 5 sec the executable should get terminated.How can I do it in the current scenario.Is there any other way to solve this problems keeping in view the requirements.
Thanks
Abhishek.
Learning is a never ending process of Life.
|
|
|
|
|
TerminateProcess()..
try to initiate your exe with CreateProcess..
WUSIWUG
|
|
|
|
|
Hi,
Does anybody know how to change the content of a html-doc before loading in a CHtmlView ? Or is it possible to view a doc from ram (in a CHtmlView) ? Or is there a possibility to prevent access to a temporarily created (and closed) file to other apps ?
tia
widi
|
|
|
|
|
I don't believe it's possible sorry.
However an alternative is to omit the Paint Cycle, then after the Document Complete event has been fired enable the paint validation Alter the DOM via the IHTMLDocument Interfaces.
You could use another method to download the content to a local dir, then use the CHTMLView to navigate to that resource, that will mean you must parse all the HTML yourself and retrieve the resources as well.
Regardz
Colin J Davies
Sonork ID 100.9197:Colin
You are the intrepid one, always willing to leap into the fray! A serious character flaw, I might add, but entertaining.
Said by Roger Wright about me.
|
|
|
|
|
Now I know why I haven't found something in the docs. Thanks.
-widi
|
|
|
|
|
It IS possible to load HTML document into htmlview from ram - see great article in Internet section ... it's name is something like loading and parsing html document 3rd way or something like that.
It writes HTML from string into IHTMLDocument , you'll get pointer to that by calling CHtmlView::GetHtmlDocument( )
rrrado
|
|
|
|
|
Thanks for your help and sorry for my late replay.
-widi
|
|
|
|
|
Is it impossible to use the CDatabase class without creating a DSN first?
CDatabase db;
db.Open(NULL,FALSE,FALSE,
"DRIVER=MySQL;DATABASE=Nish;"
"SERVER=192.168.1.1;UID=nish;"
"PWD=nish123;PORT=;OPTION=16;STMT=;");
It keeps popping up a dialog box to choose a DSN
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|