|
I am working on an MDI MFC app and have been making great progress on it, but all of sudden, when I try to use my vertical scroll bar to scroll the rich edit view, it doesn't respond. Mind you, I can still use the mouse wheel to scroll up and down, but not directly by using the vertical scroll bar.
It was working fine up until yesterday (been working on this project for roughly 2 months) when I must have changed something or adding something to the code that screwed it up, but for the life of me, can't figure out what. Please help!
Any suggestions as to what to change or edit I would appreciate!
|
|
|
|
|
Hi
does ne1 know the best way in c++ to detect if i have
a network connection, ie. connected to the internet
thanks
si
|
|
|
|
|
Does this help?
http://www.pcausa.com/resources/InetActive.txt
|
|
|
|
|
|
i dont know about the other replies and if the info there works everytime but i found the most reliable way was to try to ping a site that (hopefully) wont be down
if theres a better way they invented recently i'll be happ to know about it too
"there is no spoon" biz stuff about me
|
|
|
|
|
I've been using the following function with success. It returns
TRUE if a connection is available, and takes less than
a sec in either case:
<br />
BOOL Online()<br />
{<br />
DWORD dwState = 0; <br />
DWORD dwSize = sizeof(DWORD);<br />
return InternetQueryOption(NULL,<br />
INTERNET_OPTION_CONNECTED_STATE, &dwState, &dwSize)<br />
&& (dwState & INTERNET_STATE_CONNECTED);<br />
}<br />
Credit: I got this from Paul Dilascia's column in MSDN mag a while
back.
|
|
|
|
|
hi,
does anybody know how to install the TCP/IP via C++?
furthermore, i have to know how to set the IP number and anything like this...
Thx
CND
|
|
|
|
|
I don't think this is going to be an easy task. Different versions of windows (even service packs) have different dialogs and setup. I think Win 2K+ comes with TCP/IP installed by default. As for the IP address there are programs on this site that will do that for you. One thing to note is you can not assume that a person has 1 network card they may have 0 or 2.
John
|
|
|
|
|
Does anyone know if GDI+ 1.1 is included in the latest platform SDK. It is not part of VS.NET 2003 which is still using 1.0. The MSDN doco refers to 1.1 for a number of classes that I'm interested in.
There seems to be no information about it on the MSDN website (although it's hard to tell with the current search engine).
A few postings in newsgroups seem to indicate that the only source of this at the time of writing is as part of one of the Office 2003 products, does anyone know if this is the case.
Ta,
Jason Wilden.
Displaced Aussie. Currently in London, normally living in Melbourne.
modified 10-Jul-19 21:02pm.
|
|
|
|
|
I think it should come with the latest Platform SDK. I have it, and I think I got it by downloading the Windows Server 2003 RC2 SDK.
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
jdunlap wrote:
I have it,
How do you know you have version 1.1 ?
None of the headers i have contain version information.
The dll version is 5.1.3097.0 which doesn't tell me if it's version 1.0 or 1.1 of the API.
I have the Feb.2003 Platform SDK installed.
...cmk
Save the whales - collect the whole set
|
|
|
|
|
Up until this time, i've been programming with turbo c from 100 years ago, and i haven't had any luck communicating with a meter. The code is not the problem, we've gotten similar programs to work, but we want to try using c++ to code in.
I've been using the bioscom() function of tc, which is very easy, but now that we're looking at c++, i haven't found anything similar.
Can someone point me to somewhere that has a general description of how so use c++ to communicate with a serial port?
*.*
cin >> knowledge;
|
|
|
|
|
|
In Win32 API you use CreateFile() to open the port. Look at the docs for that. ReadFile() and WriteFile() are used to send and receive data. CloseHandle() closes the port.
John
|
|
|
|
|
Hi there,
I have the complete path of a file in a CString variable and I want that first the appropriate application should be executed and then the file should be opened.
For ex,
If the file name is "abc.doc" then first the application MS-WORD should be invoked and then the file should open in it.
Please tell me how to do this.
Gaurav Gumber
|
|
|
|
|
You can do that with ShellExecute
|
|
|
|
|
Hi,
I have a Dialogbar with some edit control into it. I want to set the focus on the first one. The focus seem to work right because the caret appear in the first edit control but my text in the control is not selected. what am I doing wrong? I would like to have the text selected so that I could change my text into the control without having to delete it first.
thanks for helping
Mykel
Everything's beautiful if you look at it long enough...
|
|
|
|
|
Use SetSel(..)
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_mfc_cedit.3a3a.setsel.asp
|
|
|
|
|
Are you calling MyEdit.SetSel(0, -1); ?
This should select the whole text content of your edit box.
[EDIT]This is the same as calling
::SendMessage(
(HWND) hWnd,
EM_SETSEL,
(WPARAM) 0,
(LPARAM) -1
); [/EDIT]
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
I have the same kind of problem ...
when my editbox received the focus, I want to select all text in it.
ON_EN_SETFOCUS(CMbCoordEdit::IDC_EDIT2, OnSetfocusControl2)
...
void CMbCoordCtrl::OnSetfocusControl2()
{
m_edit2.SetSel( 0, -1);
}
That doesn't work when clicking in the editbox.
Setting the selection manually from another function works, but not like that.
any hints ?
Thanks.
Maximilien Lincourt
"Never underestimate the bandwidth of a station wagon filled with backup tapes." ("Computer Networks" by Andrew S Tannenbaum )
|
|
|
|
|
hi there
i want to access a windows share programmaticly ( e.g. \\mycomputer\mydir\myfile)
i can do this by write code like this: cfile( "\\...", ... ) ... but a dialog is shown and asks for a username & password ...
is there any api or something like that to set username and password programmaticly?
thanks for reading
|
|
|
|
|
hello,
can someone tell me how to disable the drag&drop in a RichEdit control ?
Do I have to use IRichEditOleCallback and how ?
1MB of thanks in advance
|
|
|
|
|
Hello
I've written a logfile class that writes the logentries in xml format.
A typical usage:
mylog.WriteLog(LOG_PRIO_HIGH, "Agroup", "This is a text with %d some %s
vars", 34, "diffrent");
output
<entry date="2003-01-01" time="20:01:32:1234" prio="1"
group="Agroup">This is a text with 39 some diffrent vars</entry>
I want to accomplish the same thing by using streams/stringbuf.
But I've not found any good examples that show me how I should do.
What i've found is a couple of examples that derives a class from stringbuf and from ostream.
I would be nice of I can get something like this:
log << log_prio(1) << log_group("test") << "hello" << nIntVar << strBuf << log_end;
log << "this is a string";
log << " something more" << log_end;
log << log_prio(2) << "last line" << log_end;
would look like:
<entry date="2003-01-01" time="20:01:32:1234" prio="1" group="test">hello1yeye</entry>
<entry date="2003-01-01" time="20:01:32:2200" prio="1" group="test">this is a string something more</entry>
<entry date="2003-01-01" time="20:01:32:6600" prio="2" group="test">last line</entry>
How do I accomplish this?
Thanks,
Jonas
|
|
|
|
|
Hi All,
suppose we are on IE and we right click to open the new ie window there or use shift + click...that opens IE in new window..I want to implement such a thing that when anyone clicks on a link that opens new window or he intentionally opens it in new window..the new window shud not appear..I found something like:::
void CDWebBrowserEvents::OnNewWindow(BSTR URL, long Flags, BSTR TargetFrameName, VARIANT* PostData, BSTR Headers, BOOL FAR* Processed)
{
if (m_Browser) {
COleVariant varEmpty;
*Processed = TRUE;
m_Browser->Navigate((LPCSTR)URL, &varEmpty, &varEmpty, &varEmpty, &varEmpty);
}
}
this function call doesnt seem to work as..when I click on new window..the event is fired...but it shows an exception in *processed=true; I tried changing the definition of newwindow..but that also doesnt work becz then the function never gets called...I need it very urgently...Any help or pointers are highly appreciated..Thanks a lot in advance..
Himanshu
|
|
|
|
|
If you are getting an exception at: *Processed = TRUE; then I would assume Processed is NULL and you need:
if ( Processed != NULL )
*Processed = TRUE;
Not testing pointers for NULL is a dangerous game to play.
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|