|
Oh .. and a #pragma is a compiler command, mainly to set up a lot of things at compilation time (disabling warnings, choosing memory location for putting your variables, stuff liek that)...
~RaGE();
|
|
|
|
|
We have a LAN and are connected to the internet through a router, how do i get the internet connection ip on one of the computers in the LAN??
Kuniva
--------------------------------------------
|
|
|
|
|
One solution is via registry. Search the registry for the key that holds the system internet IP.
Kuphryn
|
|
|
|
|
Hi,
How can i load a monochrome image from a bmp file ?
Also i want to save the part of that image in an another file. How can i do that?
Regards
Neha
|
|
|
|
|
What do you mean exactly with "Load" ?
Look at the CxImage article here on CP (make a search), it should have all the features you need.
~RaGE();
|
|
|
|
|
Ok, this is kinda intense, but if anyone could help me out, i'd greatly appreciate it. My main problem is that all my integer values for my CEdit boxes are coming up as -858993460. i know whats the default value for an int, but it shouldnt be coming up like that.
Here's whats going on:
i have CPropertySheet class, CMySheet containing 5 CPropertyPage (CPage1 - CPage5) thingies. I have m_page1 - m_page5 defined as CMySheet things. I have m_sh defined as a CMySheet thing in MyProgView.h. now, when i want to get data into an edit box on page1, say its variable name is my_edit, and its an int, then in the constructor for CMyProgView::CMyProgView, i put
CPropsView::CPropsView() : m_sh("")<br />
{<br />
m_sh.m_page1.my_edit= 0;<br />
}
this makes the number 0 show up in the edit boxes. This works fine. However, i'm having trouble with another section. On page4, i have a list of radio buttons. When a user clicks on a button, a new dialog window pops up with some edit boxes.
the dialog boxes are from base class CDialog, they aren't defined as antyhing to do with my CPropertypage or CPropertysheet. I have one dialog box class names New_dialog_box.
Now, here's how i set it up.
in one cpp file, i have the domodal of the dialog box...
<br />
void CPage4::OnBnClickedRadio10()<br />
{<br />
New_dialog_box dlg;<br />
dlg.DoModal();<br />
}
I have a variable defined in New_dialog_box as an integer, its named new_dialog_edit.
Now, back in MyProgVew.h, i tried putting in the constructor of CMyPropgView the line:
m_new_dialog_box.new_dialog_edit = 0;
I declared m_new_dialog_box in
class CPropsView : public CView<br />
{<br />
private:
the exact same spot as m_sh;
I've added m_new_dialog_box(0) to the top of the constructos in MyProgView.cpp, right next to m_sh("").
When i launch the program, go to page4, click on the radio button, the value of new_dialog_edit is teh default value for an integer, -858993460. But, i've set it = 0 in the CMyProgView constructor, just like i did in all the other proeperty pages.
I've been working on this for hours, and i'm really stumped. any help would be hugely appreciated.
*.*
|
|
|
|
|
I'm not sure if I understand your problem very well, but why don't you initialise new_dialog_edit in the constructor of the New_dialog_box class ????
If I understood what you wrote, you have a New_dialog_box variable that is called m_new_dialog_box in your CPropsView but that is never used just in the constructor?? Instead of that, you declare a new instance of New_dialog_box (called dlg) in void CPage4::OnBnClickedRadio10() ??
I don't really understand what you want to do ???
|
|
|
|
|
The instance of New_dialog_box that you have in MyProgView.cpp is not the same one that is instantiated in CPage4::OnBnClickedRadio10().
|
|
|
|
|
keegan wrote:
Now, back in MyProgVew.h, i tried putting in the constructor of CMyPropgView the line:
m_new_dialog_box.new_dialog_edit = 0;
That won't work, I'm even surprised it did not crash, since you obviously try to change values of a CDialog which has still no handle.But anyway, what you should do is set up the edit boxes to 0 in the OnInitDialog function of your dialog class, that is in New_dialog_box::OnInitDialog()
~RaGE();
|
|
|
|
|
i put m_new_dialog_box.new_dialog_edit = 0;
in my onInitDialog for New_dialog_box, but it says that m_new_dialog_box is an undeclared itdentifier. i can't put it in
class New_dialog_box: public CDialog<br />
{<br />
DECLARE_DYNAMIC(New_dialog_box)<br />
<br />
public:<br />
New_dialog_box m_new_dialog_box
if i cant put it there, where else am i going to put it?
THanks for all your responses.
*.*
|
|
|
|
|
What do you want to do there ?? You cannot declare a class within itself !
Just declare a new_dialog_edit variable like this:
class New_dialog_box: public CDialog<br />
{<br />
<br />
public:<br />
int new_dialog_edit;<br />
Then initialize it at 0 in the constructor:
New_dialog_box::New_dialog_box()<br />
{<br />
new_dialog_edit = 0;<br />
...
|
|
|
|
|
holy cow, that works.
Basically, i was getting confused because i was dealing with PreopertySheets in my first case, and normal dialog boxes in the second. I was using m_sh to do something that i don't need to do with just a normal dialog box.
I knew it was something simple, and now i understand what i was doing incorreclty.
thanks
*.*
|
|
|
|
|
I would like some assistance in writting a program that draws a shape in the screen by reading the coordinates of the shape (from a comma delimited ascii file). For example it must read the coordinates of a straight line and automaticaly plot the given line i,e the coordinates 0,0 1,1 2,2 3,3 4,4 should result in a straight line. I'm using ms visual c++ version 6.0
The progoram is coded using the doc/view architecture.
Thanks
|
|
|
|
|
hi there,
first of all u will have to decvide on which event u have to draw i mean after clicking the button oe any thing like that ..
then just read the file and get the point..
the main thing starts here.
what u have to do is create a pen by calling create pen and pass the appropirate parameters.
then get the clientdc .
using the dc please call select object and pass the pen which is created in the above step .
and then using this dc call the function moveto and lineto for drawing a line
bye
TAKE CARE
best luck
Thanx
TAKE CARE
|
|
|
|
|
The MFC sample app Scribble does something very similar to what you are trying to do (though, not from a CSV). It might be worth a look.
onwards and upwards...
|
|
|
|
|
Hello Friends,
I wnat to start my application when ever it detct the live internet connection.
How can i detect the live internet connection?
Thanks
|
|
|
|
|
raghute_h wrote:
How can i detect the live internet connection?
There are a couple of ways. One is to detect when a modem dials, but that only works for dial-up connections. For LAN connections, you can try to connect to a remote system, eg. Ping a server that you know exists. It you can get to the server, then the internet connection is active. If you can't it doesn't necessarily mean that the connection is not active - the server might be down, so you have to ping a few servers, such as microsoft, google, yahoo, msn etc. If all of them don't work, then you can reasonably assume that the internet connection is not working. If one of them works, then the connection is definitely working.
Hope this helps,
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
See if this helps:
http://www.pcausa.com/resources/InetActive.txt
|
|
|
|
|
Here's one way:
bool canConnectTo (LPCTSTR url)
{
DWORD flags = 0;
if (InternetGetConnectedState (&flags,0)) {
if (InternetCheckConnection(url, FLAG_ICC_FORCE_CONNECTION, 0))
return true;
return (false);
}
return (false);
}
Sample usage:
if (canConnectTo (_T("http://www.google.com")) &&
canConnectTo (_T("http://www.yahoo.com"))){
}
} /ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
That's easier than my way, although basically the same at the lowest level
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
I have to develop an application that sends a serial packet
with a period 20 millisec.
Does WindowsNT support this performance ???
If I develop a specific driver, can I reach my target, or
20 millisec is to short also for a driver ?
Are there some solutions to have a Real Time-like performance
in WinNT ??
Thanks a lot !!!
|
|
|
|
|
[edit] See WiB's message for information on how to do this using Windows NT. It requires Windows itself to be modified, so with standard Windows it's still not possible [/edit]
Anonymous wrote:
Does WindowsNT support this performance ???
That's not an easy question. If your 20ms period must be exact, or else you get errors, then the answer is "no", Windows NT is not that accurate in its scheduling.
If the 20ms period is an average, then the answer is "maybe". A lot depends on the system load, and the other applications that are running. If this is a one-off system, then you might be able to measure the exact performance of the system, but Windows is inherently unstable and may do funny things at any time.
It may be better to use a cheap PC running Linux to handle the packet transmission, hooked up to a standard Windows PC running your application as a front-end only.
Hope this helps,
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
Anonymous wrote:
Are there some solutions to have a Real Time-like performance
in WinNT ??
you can use RTX - real-time extention for Windows NT core from Venturcom
|
|
|
|
|
Hi all,
I want to trap keys through A to Z I am using VK_A to VK_Z. but it does not recognize it at all..
is there any other way of doing it..
Please I need to do it..Any help and pointers are thoroughly appreciated..
Thanks in advance..
Himanshu
|
|
|
|
|
Not clear from where u want to trap the keys. if it is from ur app dialog just use ON_WM_KEYDOWN - OnKeyDown msg handler. Otherwise, if u want system wide key trap , see documentaion of the API SetWindowsHookEx.
Best wishes..mil10
|
|
|
|