|
Thanks.
Now,it works well.But if you would like to tell me how to make the client area's left-bottom and right bottom is round conor?
|
|
|
|
|
i'm afraid i have not done GDI and custom drawing in a sometime these days most of my development is focued on non-gui core development!
i am sure you should be able to find custom driawing how-to on this site understand mfc section, have you tryed that?
Yours Truly, The One and Only!
|
|
|
|
|
Thanks,but I has searched in this site faild.
GOOD LUCK.
|
|
|
|
|
ok here's how to do it if you're resourceful.
the first time around before you window come up you will have to grab the background and draw it into a z-buffer(off-screen buffer), only grab the rectangle area of the bottom portion you will need the round corned, follow me, then you do your non-client magic drawing in the bottom portion of your window!
that is the first step, the 2nd step once you get this working it to make it be able to grab area while your window is getting move around...remember to paint back the original screen background if that is required, most likely you will not have to worry about this last part.
hope that helps! remember just use the window DC and you will need to covert the between screen point and client point!
hope that help....learn to do this for yourself, you will be a better developer for it
Yours Truly, The One and Only!
|
|
|
|
|
I'm trying to convert and short int into 2 bytes to be send through an ethernet comm. This is what I'm trying to do:
char calcsendbuf[3];
short int data;
printf("Please Enter The Data:");
scanf("%d", &data);
calcsendbuf[0] = char(data % 256);
calcsendbuf[1] = char(floor(double(data/256)));
printf("byte 0: %u\n", calcsendbuf[0]);
printf("byte 1: %u\n", calcsendbuf[1]);
I input 32767 as the data and it should be printing 255 and 127, but I'm getting 4294967295 and 127. Any ideas of what is going wrong here, or maybe a different way of doing things?
Thanks
|
|
|
|
|
simoncoul wrote: I input 32767 as the data and it should be printing 255...
Since a char has a range of -128 to 127, trying to assign it a value of 255 will not do what you want.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
You will never get 255 with a signed char, since chars are only 1 byte (your range is 2^7 both ways). Use the unsigned char instead.
|
|
|
|
|
Ok using the unsigned char worked for the display but the send function in winsocks asks for a char *, how do I go about getting sending a single byte of 255 through ethernet using winsocks.
|
|
|
|
|
To be honest, I have no clue. I won't pretend that I know anything about winsocks, but IF (and that's a big if) all it has to do is with type conversion, you can simply cast it on the send, and cast it back when you receive it.
|
|
|
|
|
Thanks for the help I took my unsigned char array and cast it as char * in the send function and it all works now.
Thanks for all the help!!!
|
|
|
|
|
Hi guy this is so lame i cant pass parameters between classes, i feel like commiting sucide (
anyways
I have used a public variable in say class A
Public:
long iSelPackageItemID;
and assigned the value in function...
setPackageID()
{
iSelPackageItemID=some value;
}
then i have declared a function
long getPackageID()
(
return iSelPackageItemID;
)
after a long long time i call the function getPackageID()
from some another class say B and i am getting garbage value i.e. getPackageID() is returning garbage.
Whatever is the solution i just want the value from iSelPackageItemID in class B which is assigned in class a.
|
|
|
|
|
Maybe you have casting problem. post the code when you call setPackageID from your B class (before taking any action for suicide )
|
|
|
|
|
No casting since all the variables are long. I checked in the debug mode that the value is retained in the class as along the variable is in scope, but garbage value is assigned once the value goes beyond the scope. I guess i need to increase the scope of variable to application variable.. How do i do it...?
|
|
|
|
|
I dont know how exactly u had written the class,
I assumed some and written like this..
class A<br />
{<br />
public: <br />
long iSelPackageItemID;<br />
<br />
A()<br />
{<br />
<br />
iSelPackageItemID=100;<br />
}<br />
<br />
setPackageID()<br />
{<br />
iSelPackageItemID=200;<br />
<br />
<br />
}<br />
long getPackageID()<br />
{<br />
return iSelPackageItemID;<br />
<br />
}<br />
<br />
<br />
};<br />
<br />
class B<br />
{<br />
public:<br />
A ob1;<br />
<br />
<br />
<br />
};<br />
<br />
int main()<br />
{<br />
<br />
<br />
B ob2;<br />
A ob;<br />
cout<<ob.getPackageID()<<endl;<br />
<br />
cout<<ob2.ob1 .getPackageID ()<<endl;<br />
<br />
<br />
<br />
return 0;<br />
<br />
}
if ur code is similar to this than u got the solution.
If this the right solution that ur problem is,
u had given some valsue to iSelPackageItemID in the setPackageID() method, but when u create the onject to class A or B, ur members functions will not call and the valuse of setPackageID is not intialised, so give valuse to setPackageID either in constructor or call the setPackageID() function before calling getPackageID()<< method.
|
|
|
|
|
Well i solved the problem time being.
by declaring
extern long iSelPackageItemID in the .h file
and long iSelPackageItemID in .cpp file
i got help from here http://www.codeguru.com/forum/showthread.php?threadid=427587
But the core OOP funda remains unanswered, i know this is going beyond the scope but just for knowledge sake. I am also working in java and i haven't seen such kind of syntax, also in a desingning book it stated not to use a global variable since it voilates the basic rules of OOP. So is the above code a good programming practise...?
|
|
|
|
|
How are you creating "some value"? The first thing that comes to mind is that it is a variable that has gone out of scope between when you assign it and when you try to reference it.
Judy
|
|
|
|
|
I am not clear on this thing ... but now it looks like pretty much that it's going out of reference. My OOP fundas are weak... but just one question when i assign a value to a class member A, then i declare an obj of class B so when i try to access the member from a through B does it go out of scope..?
|
|
|
|
|
I'm not saying that the member itself of class A goes out of scope, I'm suggesting that what was assigned to the member went out of scope. The member itself is still good but it is referncing memory that is no longer good .You see this a lot with objects created on the stack. For example:
char *MyCreateFunc ()
{
char buffer[256]
// do all the stuff to fill in buffer
return buffer;
}
The statement
A::m_memberVar = MyCreateFunc ();
will compile and execute and may even work as expected sometimes. However, it is wrong!! A::m_memberVar remains in scope but what it points to is no longer in scope because the memory containing the data is no longer valid once the MyCreateFunc returns.
Show the code where you create the value assigned to the member of class A. The member variables of a class remains in scope until the class itself goes out of scope, so unless you're accessing class A incorrectly, the problem has got to be in the value assigned to the member variable.
Judy
|
|
|
|
|
I have an application in visual c++ relating to client and server. this appliaction does many types of work like getting all user names logged on to computers,remote shutdown,remote logoff, getting the remote desktop view and many others types of functioning related to "lan monitoring" through server. but for this , client application has to be executed all the time whenever any user logon through his local account.
but the problem is that I couldn't find any way to execute the "client exe" automatically whenever any user logon through his/her local account.But I could execute the client exe automatically for the administrator by making changes in the registry but I have to execute it "for all users".
So please help me to find any way to execute the client exe for all users automatically whenever they logon through their local account.Is there any win api or by making any registry changes or any program which can call the exe automatically whenever any user login.
ps:since this is all a part of a domain so all the other users are less priviliged than admin
HELP HELP URGENT SITUATION
RAHUL CHHABRA
|
|
|
|
|
Why not just add it to the Startup folder for All Users?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
The application you are describing would seem to operate best as a service.
Check out "Start Your Windows Programs From An NT Service" by Xiangyang Liu. This article seems to be very popular here on codeproject.http://www.codeproject.com/system/xyntservice.asp[^]
Best Regards,
Randor (David Delaune)
|
|
|
|
|
Hello, I have a property sheet that I want to check whether a specific page is Active or not. How can I get IDD of associated dialog resource in a property page I tried following code but GetDlgCtrlID() fails (returns 0). By the way I don't think it is important but anyway the property sheet is embedded in a CFormView
<br />
int nID = pDoc->m_sheetProperty.GetActivePage()->GetDlgCtrlID();<br />
if(nID == IDD_INTERESTING)
{<br />
...<br />
<br />
}<br />
thanks
|
|
|
|
|
Why does your CPropertySheet object belong to the document class rather than the view class?
Electronic75 wrote: )//nID is always zero
As it probably should be. GetDlgCtrlID() is for returning the ID of controls on dialog boxes or property pages.
I've never known it necessary to query a dialog box's ID. In any case, I'd be more inclined to compare the return value of GetActivePage() with the class objects associated with the various pages. For example:
CPropertyPage *p = pDoc->m_sheetProperty.GetActivePage();
if (p->IsKindOf(RUNTIME_CLASS(CMyOtherPage)))
...
else if (p->IsKindOf(RUNTIME_CLASS(CTheLastPage)))
...
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi David, Well it is a MDI application that I did bizarre things to make it look nicer. eg. it has a property page embedded in a CFormView and even another CDocTemplate(Doc, View, Frame) embedded in one of the pages. It maybe bizarre but it looks good!
|
|
|
|
|
Hi,
I am trying to run my code in a different system, which is working on my system. But it gives me this error. I checked the path for afxhelp.hm...its correct and is fine...
Can anybody help me with this error please....
Here is the entire copied error message.............
*****************************************************************
Copying contents file...
1 file(s) copied.
Making help include file...
Making help file...
hlp\OperationTool.hpj(1) : error:
Microsoft (R) Help Compiler
HCRTF 4.03.0002
Copyright (c) Microsoft Corp 1990 - 1995. All rights reserved.
operationtool.hpj
HC3037: Warning: D:\Sridhar\Official\NGN\NGN_3\kcj\ngn\OperationTool\hlp\OperationTool.hm :
The map value for "HIDD_SYSTEMCONFIGURATION" is the same as the map value for "HIDR_CSMENU".
HC3037: Warning: D:\Sridhar\Official\NGN\NGN_3\kcj\ngn\OperationTool\hlp\OperationTool.hm :
The map value for "HIDD_SYSTEM_CONFIGURATION" is the same as the map value for "HIDR_CSMENU".
HC3037: Warning: D:\Sridhar\Official\NGN\NGN_3\kcj\ngn\OperationTool\hlp\OperationTool.hm :
The map value for "HIDD_CLIENT_CONFIGURATION" is the same as the map value for "HIDD_CONFIGURATION".
HC3037: Warning: D:\Sridhar\Official\NGN\NGN_3\kcj\ngn\OperationTool\hlp\OperationTool.hm :
The map value for "HIDD_CHANNELCONTROL" is the same as the map value for "HIDD_CHANNELPARAMETERS".
HC3037: Warning: D:\Sridhar\Official\NGN\NGN_3\kcj\ngn\OperationTool\hlp\OperationTool.hm :
The map value for "HIDD_CHANNEL_CONTROL_DIALOG" is the same as the map value for "HIDD_CHANNELPARAMETERS".
HC3037: Warning: D:\Sridhar\Official\NGN\NGN_3\kcj\ngn\OperationTool\hlp\OperationTool.hm :
The map value for "HIDD_RESEND_CONTROL_DIALOG" is the same as the map value for "HIDD_RESENDCONTROL".
HC3037: Warning: D:\Sridhar\Official\NGN\NGN_3\kcj\ngn\OperationTool\hlp\OperationTool.hm :
The map value for "HIDD_DATA_CONTROL_DIALOG" is the same as the map value for "HIDD_DATACONTROL".
HC3037: Warning: D:\Sridhar\Official\NGN\NGN_3\kcj\ngn\OperationTool\hlp\OperationTool.hm :
The map value for "HIDD_MAC_CONTROL_DIALOG" is the same as the map value for "HIDD_MACCONTROL".
HC3037: Warning: D:\Sridhar\Official\NGN\NGN_3\kcj\ngn\OperationTool\hlp\OperationTool.hm :
The map value for "HIDD_EVENT_LOGGER" is the same as the map value for "HIDD_LOGGER".
HC3037: Warning: D:\Sridhar\Official\NGN\NGN_3\kcj\ngn\OperationTool\hlp\OperationTool.hm :
The map value for "HIDD_CONNECTION_PREFERENCES_DIALOG" is the same as the map value for "HIDD_CONNECTION_PREFERENCES".
HC3037: Warning: D:\Sridhar\Official\NGN\NGN_3\kcj\ngn\OperationTool\hlp\OperationTool.hm :
The map value for "HIDD_CONFIGURATION_SETTINGS_DIALOG" is the same as the map value for "HIDD_CONNECTION_PREFERENCES".
HC1002: Note:
Using existing phrase table: OperationTool.ph.
HC3025: Warning: topic #1 of D:\Sridhar\Official\NGN\NGN_3\kcj\ngn\OperationTool\hlp\.\afxcore.rtf :
Jump to undefined Topic ID: "menu_record".
HC3025: Warning: topic #3 of D:\Sridhar\Official\NGN\NGN_3\kcj\ngn\OperationTool\hlp\.\afxcore.rtf :
Jump to undefined Topic ID: "HID_OLE_EDIT_LINKS".
HC3025: Warning: topic #3 of D:\Sridhar\Official\NGN\NGN_3\kcj\ngn\OperationTool\hlp\.\afxcore.rtf :
Jump to undefined Topic ID: "HID_EDIT_PASTE_LINK".
HC3025: Warning: topic #3 of D:\Sridhar\Official\NGN\NGN_3\kcj\ngn\OperationTool\hlp\.\afxcore.rtf :
Jump to undefined Topic ID: "HID_OLE_INSERT_NEW".
HC1010: Note:
The following mapped Topic IDs were not used in any topic:
AFX_HIDP_UNREG_DONE
HID_CONNECTION_CONNECT
HID_TOOLS_EMT_LOGSAVE_ON
HID_SYSTEM_USER_STATUS
HID_TOOLS_EMT_LOGSAVE_OFF
...// so on..i have removed them here
...
...
HID_CLOSE
HID_OTHERCONTROLS_DATACONTROL
72 Topics
48 Jumps
16 Keywords
21 Bitmaps
Created D:\Sridhar\Official\NGN\NGN_3\kcj\ngn\OperationTool\hlp\OperationTool.HLP, 38,928 bytes
Bitmaps: 5,348 bytes
Phrase+Zeck compression decreased help file by 13,866 bytes.
Compile time: 0 minutes, 0 seconds
2 notes, 15 warnings
Compiling resources...
Compiling...
StdAfx.cpp
Compiling...
Generating Code...
Linking...
OperationTool.exe - 1 error(s), 15 warning(s)
Please respond soon.
Thanks,
Sridhar
|
|
|
|