|
afaik toolbars are similar to modeless dialogs so u could do it that way depending on what u exactly wanted
"traffic lights are for people who can't make their own decisions" biz stuff about me
|
|
|
|
|
No, modeless dialog can only float above parent dialog if set wndTopMost.
Modeless CDialog also takes away parents focus, CToolbar doesn't.
|
|
|
|
|
I've got two questions:
1. How do I retrieve the hard disk's serial number from w/in c++? I need to store the SN in a CString object.
2. How do I create/destroy a directory on the fly? I have a CFile object that should create a file and directory. The statement CMyFile("c:\\myfolder\\file.txt",CFile::modeWrite | CFile::modeCreate) will not work if the directory does not already exist. The same goes for CMyFile.Destroy("c:\\myfolder\\file.t").
Thank you all and have a great Xmas,
Ralf
ralf.riedel@usm.edu
|
|
|
|
|
RalfPeter wrote:
How do I retrieve the hard disk's serial number from w/in c++? I need to store the SN in a CString object.
GetVolumeInformation
RalfPeter wrote:
How do I create/destroy a directory on the fly? I have a CFile object that should create a file and directory. The statement CMyFile("c:\\myfolder\\file.txt",CFile::modeWrite | CFile::modeCreate) will not work if the directory does not already exist. The same goes for CMyFile.Destroy("c:\\myfolder\\file.t").
You cannot do that in one step. Create the directory first and then create the file
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
RalfPeter wrote:
1. How do I retrieve the hard disk's serial number from w/in c++?
Too bad, you weren't here yesterday. There was an article all about this. But I think it has been pulled.
Nish has provided you with what you are seeking, though.
Chris Meech
"what makes CP different is the people and sense of community, things people will only discover if they join up and join in." Christian Graus Nov 14, 2002.
"AAAAAAAAAHHHHHH!!!!! Those leaks are driving me crazy! How does one finds a memory leak in a garbage collected environment ??! Daniel Turini Nov. 2, 2002.
|
|
|
|
|
RalfPeter wrote:
1. How do I retrieve the hard disk's serial number from w/in c++?
Read up on SPTI (SCSI Pass-through Interface - and don't be fooled by the SCSI part, even IDE drivers nowadays are SCSI miniport drivers) and check your vendors drive-specific documentation.
|
|
|
|
|
I want to learn codeing some device drivers.Can someone guide me to some sample code or article?
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
dnload the ddk from microsoft and squizz thru the examples
then post here and im sure u will get answers to specific questions
"traffic lights are for people who can't make their own decisions" biz stuff about me
|
|
|
|
|
Thanks luraren,Sorry ,Maybe this is dumb question,what is DDK?
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
its a device driver developer kit (hmmmm should that be dddk?)
its like an sdk but for device drivers ... its a weird world in there trust me ... like nish says get a good book and look at the examples from the ddk
i dont have a link but its on ms somewhere
"traffic lights are for people who can't make their own decisions" biz stuff about me
|
|
|
|
|
hmmmm,thanks to both of you.
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
Mazdak wrote:
I want to learn codeing some device drivers.Can someone guide me to some sample code or article?
It's not an easy thing to do Mazy. best bet is to download the DDK and play with it. Also buy one book if possible.\
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
I am trying to create a program that does BASIC pig latin translation. I start the program by tokenizing a phrase and then transferring the tokens to a function called printLatinword. In the process of transferring the tokens, I am getting errors. Please help.
char printLatinword (char);
int main()
{
char phrase[200];
char *tokenPtr;
cout << "Enter a phrase in which all words have two or more letters: ";
cin.getline( phrase, 200, '\n');
tokenPtr = strtok(phrase, " ");
while( tokenPtr != NULL ) {
cout << tokenPtr << '\n';
char x= printLatinword(tokenPtr);
cout << x;
tokenPtr = strtok( NULL, " ");
}
system("PAUSE");
return 0;
}
char printLatinword( char *tokenPtr){
char add = 'ay';
char newWord = strncat(tokenPtr, add, 1);
char word = strcat(tokenPtr, newWord);
return word;
}
|
|
|
|
|
Uhhh... a char is 1 byte. strcat returns a pointer. You're totally mixing pointers and atomic types up - come to think of it, looks like you're mixing Basic and C up, too.
"Perhaps the truth is less interesting than the facts?" -- Amy Weiss, RIAA's Senior Vice President of Communications. It's the new math! 421 == 156 !
|
|
|
|
|
Hello world...
Anybody can tell me how to play a Flash file (swf) into a dialog box...
Thanks in advance!!!
Hello World!!!
from Raphaël
|
|
|
|
|
Possibly use the Microsoft web browser control?
|
|
|
|
|
heh this is the third time i answered this exact question
i'll put some code together to show u how
its really simple when u see it
"traffic lights are for people who can't make their own decisions" biz stuff about me
|
|
|
|
|
Problem.
Let's say I have dialog based program, which dynamic creates two buttons in InitDialog:
pBtn1 = new CButton();
pBtn1->Create("test1", WS_VISIBLE | WS_CHILD, CRect(20, 220, 100, 300), this, 350);
pBtn2 = new CButton();
pBtn2 ->Create("test2", WS_VISIBLE | WS_CHILD, CRect(60, 240, 150, 300), this, 351);
In this case button pBtn1 overllaps pBtn2.
Question.
What should I do that pBtn2 would be Top-Most. I mean:
* pBtn2 above pBtn1;
* pBtn2 gets mouse message WM_SETCURSOR on overllaped area.
I tried:
1) pBtn2->BringWindowToTop();
2) pBtn2->SetWindowPos( &wndTop, 0,0,0,0, WP_NOSIZE|SWP_NOMOVE );
In both case I got:
* pBtn2 gets mouse message WM_SETCURSOR on overllaped area.
* pBtn1 above pBtn2;
Please, help me. It's urgent
|
|
|
|
|
try to set the position as wndNoTopMost
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Hi,
I have a dialog based application. I had set the window styles
as WS_MINIMIZEBOX,WS_MAXIMIZEBOX etc.. There is no WS_SYSMENU.
When my application is running i can minimize or restore by clicking
on the icon in the task bar.This works fine in 2K.But it doesn't work in
98. In 98 if i set WS_SYSMENU it works,But i don't want that option.
Can anyone tell me how to acheive this without setting WS_SYSMENU option?
Regards
|
|
|
|
|
IIRC, according to the documentation you must also request a SYSMENU is you want any of the minimize, maximize or close styles.
Actually, just reading the documentation (in this case an age-old VC6 MSDN for CreateWindowsEx) it clearly states
WS_MINIMIZEBOX - Creates a window that has a Minimize button. Cannot be combined with the WS_EX_CONTEXTHELP style. The WS_SYSMENU style must also be specified.
Perhaps reading a little documentation would benefit us all?
|
|
|
|
|
how can i Set a CWnd object attributes to be Locked that other objects can't affect it.
for example if i have 2 CWnd object in the main window and i move one of them across another it will clean another CWnd object.
or if i draw a line in main window it will affect the CWnd object and it's contents.
how can i Lock a CWnd object againt to be affected ?
|
|
|
|
|
Think of it this way:
that CWnd is merely the class wrapping an interface to
an object owned by another application. Windows don't belong
to you, they belong to the operating system. They aren't yours
to "lock."
What that window is there to represent is something of yours
and you simply repaint the window as necessary from it.
Pedantic diatribe aside. Sounds like you are trying to prevent
the window from being invalidated (scheduled to receive WM_ERASEBKGND,
WM_NCPAINT, WM_PAINT and ilk). If it is a window that incurs a
performance hit to render, you might consider rendering to an
offscreen image that is used for paint handling and use an internal
refresh method to update the image. That's one strategy. There are
lots but it depends on what sort of problem you're trying to solve
here.
|
|
|
|
|
first thanks for your great answer and second Forgive me for my bad English
let me explain my problem:
i have Some CWnd objects. each of them contains a Bitmap and a figure that will shown on the bitmap .
plz See this AVL Tree Applet : http://www.seanet.com/users/arsen/avltree.html[^]
i can Drag and Drop this CWnd objects. Even i Drag a CWnd object and move it around if it move across another one it will Clean that CWnd object.
this objects must be transparent. it seems that the only way is to even i move the mouse i have to ReDraw all the CWnd objects.
my another problem is even i draw a bitmap in CWnd and then i do Invalidate(); it cleans that CWnd how is that possible ??
and another thing is i have no code in OnDraw function :
void CMy15View::OnDraw(CDC* pDC)
{
CMy15Doc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
}
here is the code :
<br />
<br />
CW[1]->Create(NULL, "",SS_BITMAP|WS_VISIBLE|WS_CHILD |WS_CLIPCHILDREN|WS_EX_TRANSPARENT ,CRect(100, 100, 126,126), this, 0xffff); <br />
<br />
<br />
CFont cf;<br />
cf.CreateFont (16,0,0,0,FW_BOLD|FW_EXTRALIGHT,0,0,0,DEFAULT_CHARSET,OUT_CHARACTER_PRECIS,CLIP_CHARACTER_PRECIS,DEFAULT_QUALITY,DEFAULT_PITCH|FF_DONTCARE,"Arial");<br />
<br />
<br />
CBitmap b;<br />
b.LoadBitmap(IDB_BITMAP1);<br />
<br />
BITMAP bm;<br />
b.GetObject(sizeof(BITMAP),&bm);<br />
<br />
CClientDC h2(CW[1]);<br />
h2.SetBkMode(TRANSPARENT);<br />
CDC *dc=new CDC;<br />
dc->CreateCompatibleDC(&h2);<br />
dc->SelectObject(&b);<br />
<br />
<br />
h2.SetTextColor(RGB(10,50,220));<br />
h2.SelectObject(cf);<br />
<br />
h2.DrawText("13",CRect(2,5,25,25),DT_CENTER);<br />
<br />
h2.BitBlt(0,0,bm.bmWidth,bm.bmHeight,dc,0,0,SRCAND);
<br />
<br />
|
|
|
|
|
Do your painting of the window in OnDraw.
You must repaint a window whenever required.
Handle the WM_ERASEBKGND message; do nothing
and return TRUE so that your window is not
erased using its background brush.
You should probably register a new window
class for these (AfxRegisterWndClass) using
the CS_SAVEBITS style and having a null
background brush.
|
|
|
|