|
Hi there
I have MDI application.
Child MDI window consists of CMDIChildWnd and CView.
What events and what situation I should handle in
CMDIChildWnd and what I should handle in CView?
Second question, if I need to change size of CView then
I have also change
size of CMDIChildWnd, is it true?
In CView I inserted CPropertySheet and I need to make size of child MDI
window the same as size of inserted CPropertySheet, what is the right way to do it?
|
|
|
|
|
how can i change the SELECTION color of an edit?
(the default color looks bad with my custom ui )
thanks in advance
|
|
|
|
|
|
actually i mean the background color of selected text
(any other than rgb(0,0,128) which is the default color for that)
any ideas ?
|
|
|
|
|
Hi,
I have a complicated (to me) problem reading/Writing data in binary. Here is what I am doing.
For example let say a text file has the following:
File: test.txt
-----------------
1234a5678b9
-----------------
Here is what I am doing:
istream inData;
ostream outData;
inData.open("test.txt", ios::in | ios::binary);
outData.open("modified.txt", ios::out | ios::binary);
inData.seekg(0, ios::end);
int size = inData.tellg();
char *temp;
temp = new char[size + 2];
inData.read(reinterpret_cast<char *="">(temp), size);
temp[size + 1] = 'c';
temp[size + 2] = 'd';
outData.write(reinterpret_cast<char *="">(temp), (size + 2);
-----------------------------------------------------
The code above should work okay. As you can see, all I am doing is reading data from a file, add two characters "c" and "d" and then writing it back to the file. Everything is fine.
Now, let say I read the modified file back.
Here is what I am doing:
istream modData;
ostream weird;
modData.open("modified.txt", ios::in | ios::binary);
weird.open("hungry", ios::out | ios::binary);
inData.seekg(0, ios::end);
int size = inData.tellg();
char *temp, charA, charB;
temp = new char[size];
inData.read(reinterpret_cast<char *="">(temp), size);
charA = temp[size - 2];
charB = temp[size - 1];
-----------------------------------------------------
Do you see what I am trying to doing?
1)read fileA in binary
2)save data from fileA to tempX
3)add characters to tempY
4)write temp to fileB
-----------------------
1)read fileB in binary
2)save data from fileB to tempZ
3)extract ONLY those characters I added to tempX from tempZ
-----------------------
The method I use to extract the added characters from the modified file after I read it back is subscript. I assume let say temp[5] is 'a'. When I read the data back, I look at temp[5].
My question is when you read a file in binary, add characters to it in specific spaces and write it to modified file, is it possible to read the data from the modified file and extract those characters you added via assumption subscript? How are data saved when you read and write in binary?
Thanks,
Kuphryn
|
|
|
|
|
I see some problems with what you are doing.
First, arrays are zero-based. To append two characters to the end of an array of size means you write to temp[size] and temp[size+1]. The write command with (size+2) is then correct. Accessing [size+2] means you must allocate and write (size+3) items. The last of the original data will be at index (size-1).
To extract only the characters you added then seek to position size on your input stream and then read 2 items.
|
|
|
|
|
Interesting. Thanks.
I got everything write. When I read teh modified data back, sometimes it comes out right and sometimes it does not. I do not know if it is writing the modified file differently everytime.
Kuphry
|
|
|
|
|
Is possible to rebuild IntelliSense ASC stores found in <msvs-root>\Common\MSDev98\Bin (Win32.ncb, Mfcatl.ncb and Crt.ncb) ? Simply deleting them only disables code editor's IntelliSense features
I'd needed to recreate them because they contains in some instances improper data, f.E. incorrect number of function parameters, wrong return type etc. - it could be very confusing.
Does anybody know how to solve this problem or knows something about internal format of .ncb files ? I know there is a good replacement called Visual Assist from WholeTomato software but it isn't free
Thx
Cernd
|
|
|
|
|
In my SDI MFC app there's a CMainFrame, and I don't want it to be resizable. How I can do that? Thanks for the help
|
|
|
|
|
Remove the WS_THICKFRAME style
Nish
|
|
|
|
|
Where can I find it??? in the CREATESTRUCT cs??? In the MSDN there isn't any help for the CREATESTRUCT
|
|
|
|
|
Hi,
I need to know that whether its possible to have server based on WinSock and Client based on CAsyncSocket?
I tried so but did not succeed.. Before i put my full efforts i need to nkow if it is possible or not..
If there is something special work needed to be done to make it work, then do specify it..
Thanking u in advance
RawCoder
|
|
|
|
|
|
If you have a network (LAN), go to your network connections in Control Panel and right click on the Local Area Connection (or whatever you have there). You can make it "Enable" or "Disable" (connect or disconnect). Now my question is how to do this programmatically in Windows 2000? I was looking in MSDN and didn't find nothing.... Change user info, get domains.... all what you want but not something like Connect or Login.
IF someone knows the answer, please tell me
Thanx
Philip Patrick
|
|
|
|
|
- Can you help?
- Regards,
Maer
|
|
|
|
|
if you are asking about #ifndef then the main difference is the #if form permits complex expressions such as :
#if( !define(THIS) && !define(THAT) && !(THE_OTHER_THING) )
I don't believe that #ifndef supports this type of expression. It may but I have never seen any.
|
|
|
|
|
- Thanks pal!
- I think the statement "#if( !define(THIS) && !define(THAT) && !(THE_OTHER_THING) )" should be
#if( !define(THIS) && !define(THAT) && !define(THE_OTHER_THING) )
- Am I right?
- Regards,
BigMouth
|
|
|
|
|
Yep, I missed that last define.
I was just testing you.
Actually, they should all say defined but your compiler would tell you that soon enough.
Good Luck.
|
|
|
|
|
- Thanks pal!
- I think you are smart and warm-hearted.
- Regards,
BigMouth
|
|
|
|
|
- Can you help?
- Regards,
Maer
|
|
|
|
|
_DEBUG is the standard definition that VC++ uses when performing a debug build. I don't know about DEBUG. I couldn't find it in the docs.
|
|
|
|
|
|
- Can you help?
- Regards,
Maer
|
|
|
|
|
It is used to prevent a header file from being included more than one time.
|
|
|
|
|