|
once you create your icon, save it to your resource directory. Then from the resource view tab, select IDR_MAINFRAME, then right click. A popup menu will show then select properties and you should see the properties dialog for IDR_MAINFRAME. The edit box at the bottom labeled file name needs to point to the path of the new icon in your resource directory. Close the dialog then your icon will be associated with IDR_MAINFRAME.
Cheers
Jay Beckert
sorry for the re-reply My typo's made it hard to understand.
|
|
|
|
|
I think there is a bug in the autogenerated code, so if you try modifying your PreCreateWindow function to look like below, it should work.
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
if( !CFrameWnd::PreCreateWindow(cs) )
return FALSE;
return TRUE;
}
Cheers,
/Fredrik
Sonork ID: 100.11430:PhatBoy
|
|
|
|
|
i have tried the above 3 ways by juz using a totally new and empty MDI application. but it doesn seem to work. only the icon in the ABOUT dialog changes. how can i actually load the icon into the mainframe and the child frame.
i have been trying these for weeks. hope some1 can help mi
|
|
|
|
|
Please, help me! I have external device, which connects with comm-port.
I send to device the number, after it signaled it send to computer some signal;
how can i receive this signal? in case, if device is nonsignaled, how can i wait
it for five sec, and break the waiting operation?
What do i need to write to this code, in the end of it?
I know all abot WaitCommEvent and WaitForSingleObject, but i don't know
how to use it. WaitForSingleObject doesn't work with EVENT, or i don't know
how to use it
HANDLE port;
DWORD bc;
DCB dcb;
char buffer[100];
char *buf_out="50";
DWORD dwBlockSize=512;
void *szBuffer;
int send=255;
ZeroMemory(&dcb,sizeof(DCB));
strcpy(buffer,"baud=1200 parity=N data=8 stop=1");
BuildCommDCB((char*)&buffer,&dcb);
dcb.fRtsControl = RTS_CONTROL_ENABLE;
port=CreateFile("COM1",
GENERIC_READ|GENERIC_WRITE,
0,
NULL,
OPEN_EXISTING,
0,
NULL);
GetCommState(port,&dcb);
SetCommState(port,&dcb);
HeapFree(GetProcessHeap(),0,&dcb);
szBuffer = malloc(dwBlockSize);
memset(szBuffer, send, dwBlockSize);
// Sending number for device
WriteFile(port,szBuffer,sizeof(szBuffer),&bc,NULL);
free(szBuffer);
// Wait for signal for five sec
CloseHandle(port);
|
|
|
|
|
(1) Init an event by using CreateEvent()
(2) Add in OVERLAPPED struct to your code
(3) Insert the event (1) into (2)
(4) CreateFile() with FILE_FLAG_OVERLAPPED
Now call WaitCommEvent() with LPOVERLAPPED = (2) whereever you want. Wenn the specified com-event occurs the event (1) will be set to signaled state. You should wait for it with WaitForSingleObject() in a seperate thread.
Stay heavy ... RockNix///
-------------------------------
Look out for free Win32
Serial Communication Module
for VC++ or Borland C++ Builder
on http://www.klangwerker.de
-------------------------------
|
|
|
|
|
Hi. Does anyone know how to check if a printer is actually connected before sending anything to it. I am sending things to the printer automatically after so often. However, if nothing is connected, I want to not do it.
THanks in advance.
|
|
|
|
|
As I know, OpenPrinter doesn't check if printer is really connected. EnumJobs tries to talk with printer and fails if it is not connected. If printer is not local and it's network computer doesn't respond, call to EnumJobs may take number of seconds, as any network call.
|
|
|
|
|
I want to play two mpeg files simultaneously, just as picture in picture(the small one overlay the big one). I used two mediaplayer ActiveX controls. How can I accomplish that?
Thanks for advice in advance.
Windows98 SE, VC++ 6.0 SP5
|
|
|
|
|
I don't know if this could help you because I do it in VC7 but try to do this , it may help
you: (you can do for both of your ActiveX)
*In property page of them set the "AutoStart" property to "false".
*Set the "FileName" the path of your file.
*You can use "play()","stop()","pause()" function in your code.
I could not find any function for changing "FileName" property
Mazy
You can find a solution (even a foolish one) for all problems (even big ones)
|
|
|
|
|
I want to know if there is a way that can merge the two video sources (as picture in picture).
Thanks.
Windows98 SE, VC++ 6.0 SP5
|
|
|
|
|
Hi all,
How can i change the my DATABASE path by Crystal Report ActiveX ? which function ?
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
How do I access a childwindow in a MDI-App? I have made a CEditView MDI and I don't know how to GetActive the active window for modification.
Thanks in advance.
-- Kelthar :: icq9071676 :: http://uteliggare.net/southern/ --
|
|
|
|
|
CMDIChildWnd* pActiveChild = MDIGetActive();
if( pActiveChild != 0 )
{
.....
}
Mazy
You can find a solution (even a foolish one) for all problems (even big ones)
|
|
|
|
|
What would be the appropriate terminology for the opposite of fence post/stack overflow, out of bounds checking...?
In my code I check for overflow of 'My' stack and underflow??? when going in the opposite direction.
Does this sound right? For some reason i'm thinking theres a cooler term like reciprocal correction or something...
ANy ideas?
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Alright All I want is to add some OBject say Student(Name n, ID i)
to some array Students[], but in alphabetical order,
or can you just tell me whatever way to sort Strings alphabetically
that might save my life
|
|
|
|
|
Use strcmp to compare to strings.
int StrCmp(
LPCTSTR lpStr1,
LPCTSTR lpStr2
);
Parameters
- lpStr1
- [in] Pointer to the first null-terminated string to be compared.
- lpStr2
- [in] Pointer to the second null-terminated string to be compared.
Return Values
Returns zero if the strings are identical. Returns a positive value if the string pointed to by lpStr1 is greater than that pointed to by lpStr2. Returns a negative value if the string pointed to by lpStr1 is less than that pointed to by lpStr2.
Remarks
This function returns the difference in value of the first unequal characters it encounters, or zero if they are all equal. For example, if lpStr1="abczb" and lpStr2 = "abcdefg", StrCmp determines that "abczb" is greater than "abcdefg" and returns z - d.
This is how you would determine if one string should go before or after another string, then you could write your own sorting algorithm, or you could use the sort function in STL.
|
|
|
|
|
Do some homework on Quick sort which i think is the fastest, but BubbleSort i believe is the easiest to implement.
Are you working with C arrays or MFC/similar string class?
"An expert is someone who has made all the mistakes in thier field" - Niels Bohr
|
|
|
|
|
The best way is to use real (i.e. STL ) containers. If you use vector, you have an array, which can be indexed in the normal way, but you can also call std::sort, and that's just the beginning.
christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Picture the daffodil. And while you do that, I'll be over here going through your stuff.
Picture a world without war, without hate. And I can picture us attacking that world, because they would never expect it.
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
hi all
can anybody tell me how do you insert some objects of some type in some array in (alphabetical order)?
or is there anyway you can make your objects comparable like in JAVA??
THANKS FOR ANSWERING MY QUESTION
|
|
|
|
|
Are you using STL, or a plain array data type.
You are on your own if you are simply creating an array of some sort of object.
However if you are using the STL set or map class, the items will be inserted in order. Then again if you use the vector, after you insert all of the items you could use the sort function to sort the items.
If you are more specific with your problem, I may be able to suggest a better solution.
|
|
|
|
|
ok here is what i want to do:
let's say i have an Object of type Stock(nameOFStock, initialValue,....)
lets's say i want to add all my Stock objects to some array called stocks
but i want to add them in alphabetical order.
you know what i mean now?
thanks for your time.
|
|
|
|
|
How are you going to access the array? If you want to perform a lookup based on the name of teh stock, I would simply use the STL map. You can add items and it will automatically sort the items. So if you use an iterator to view all of the objects in your map, they will be sorted.
Also you can create a map like this:
<br />
map<char*, CStock*> mapStock;<br />
then you can add items like this:
<br />
mapStock["msft"] = new CStock(...); <br />
and you can later access the object like this:
<br />
CStock *stock = mapStock["msft"];<br />
It is a pretty easy container to use, it sounds like it would be a good fit for your case.
|
|
|
|
|
Hi all,
Does anyone knows where can I find a sample program which will perform course enrolment functions ? Thanks.
Anna D.
|
|
|
|
|
That sounds like a DNA with web services.
Try WROX DNA at amazon.com search.
I dunno about your program.
Be more specific,heh¿
Antoine
Coming home from Vancouver. I look like a hobo! lol
|
|
|
|
|
hi Antoine,
sorry for not beening specific enough with my problem, I am looking for a program that allows an user to enrol a course by entering a user ID under DOS prompt. Would you know any similar program to this on the net? thank you for your help.
Anna D.
|
|
|
|