|
You used CRect(23,30,54,14); as the location to move the window to.
This statement create a rect with the following settings:
- m_Rect {top=30 bottom=14 left=23 right=54}
- tagRECT {top=30 bottom=14 left=23 right=54}
left 23
top 30
right 54
bottom 14
Since "bottom" is less than "top" this is a rect with a negativ height.
I am pretty sure that was not your intention, was it?
Jens
|
|
|
|
|
Most of the time, creating controls at runtime is not necessary. Can you explain a bit more of what you are doing?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
I just wanted to play around with dynamic controls
I've given code snippets in the reply before yours.
Thanks Alton
|
|
|
|
|
Yes, I understand!! I'm trying to create a MenuBar at runtime but all itens in the menu is GRAYED (disabled) when created!!! I don't know why?!?!?
Maybe some help in your doubt helps in mine!!!
Thanks
Marcos Vinícius
|
|
|
|
|
If your using MFC one of the more common mistakes is that there is no command handler yet. In that case MFC grayes all the unavailable menu commands.
Jens
|
|
|
|
|
But, why is it unavailable? I can't just put a Message_Map in my class that handle the App MenuBar and that will enable the MenuItens?
Take a look in my last thread posted:
Menu at runtime (dynamic menu)
Thanks.
Marcos Vinícius
|
|
|
|
|
okay here it goes ...
my app crashes cause of a DLL (coded correctly)
my DLL is accessing to a file, only to read ...
isn't it allowed to a dll to read a file? how to fix it ?
is there maybe another error?
Its a simply Win32 dll with CPP, Header and Def file
and my app is a console app (MFC apps crash too)
the debugger links me to "output.c"
if i write other console apps it crashes too ...
can any1 help me?
int main(int argc, char* argv[])<br />
{<br />
if (argc < 2)<br />
{<br />
printf ("Usage is: <CharFile> \n");<br />
getchar();<br />
return 1;<br />
}<br />
char * output = "";<br />
char hash[5] = "abcd";
char * outputfile = "";<br />
sprintf(outputfile,"%s.txt",argv[1]);<br />
FILE * fp = fopen(argv[1],"r");<br />
FILE * f = fopen(outputfile,"wt");<br />
<br />
if (!fp)<br />
{<br />
printf ("Error opening file %s\n", argv[1]);<br />
getchar();<br />
return 2;<br />
}<br />
int findex = 0;<br />
unsigned char d;<br />
while (!feof(fp)) <br />
{<br />
int c = fgetc(fp);<br />
if (c == EOF) break;<br />
unsigned char k = (hash[findex % 4] + findex) % 256;<br />
d = c ^ (k | 0x80);<br />
findex++;<br />
output += (char) d;<br />
fprintf(f,(const char *) d);<br />
}<br />
fclose(fp); <br />
fclose(f);<br />
return 0;<br />
}
|
|
|
|
|
How can I move the caret in an CEdit control forward or backward in characters, not in coordinates?
SmileAgain
|
|
|
|
|
Perhaps CEdit::SetSel (nCharPos, nCharPos, TRUE) ?
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Hi,
I want to create the following splitters.
1. ParentSplitter - 2 cols and 1 row (vertical split)
- derives from CFrameWnd-SDI based
- 1st pane has a class derived from CTreeView (so this will be SDI-based)
- 2nd pane should be ChildSplitter
2. ChildSplitter - 2 rows and 1 col (horizontal split)
- derives from CMDIChildWnd-MDI based
- 1st pane and 2nd pane will derive from CFormView
So basically I want the parent to be SDI-based as its 1st pane (the TreeView) is SDI-based but its 2nd pane needs to be a MDI-based splitter. this application should look more or less like visual studio 6 having a tree on the left pane and double-clicking on a file should open a new window on the right pane ...
Can this be done? .. or is there any work-around for this concept .. If so can anyone plz guide me ...
thanks a lot
|
|
|
|
|
I faked this by creating a standard MDI app, using a docking window for the tree view. My "tree view" is actually a dialog template that houses a tab control, which displays various views (tree, list) of the open "project". It seems you're trying to do the same thing.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
I made a simple prog in console that listed ALL the ip's that are possible... don't ask, and I stumbled onto a problem, I was storing those ip's into a txt file, but when the ip's were only on 1.0.0.0 the txt file was aproximatly 200mb, you know .2gb, anyways does anyone know how to make that file smaller or is that the smallest I can get?
Actual Linux Penguins were harmed in the creation of this message.
|
|
|
|
|
There are a few ways I can think of, but it's hard without more information.
1. Don't store it as text, save them as binary groups of four bytes
2. Only store the changes between each digit (0.0.0.[x0, x1, .. x254, x255], 0.0.1.[x0, x1, .. x254, x255], ...)
3. Don't save them at all, just generate them on the fly, this would be ideal but it depends on your situation.
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts you aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
Snyp wrote:
ALL the ip's that are possible...
I second Andrew's suggestion: there's no need to store these on disk - simply generate them on the fly.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
I just wanted to do this for fun, to see what and how large it would be, I have a 30 gig hard drive and I calculated the document to come out aproximatly 50 gigs!!!!
Actual Linux Penguins were harmed in the creation of this message.
|
|
|
|
|
You know there are 4 billion of them, generating them is like counting from 0-0xffffffff. Uncompressed binary storage would require 16GB.
But making a computer count from 0-4 billion seems rather pointless.
Paul
|
|
|
|
|
Paul Ranson wrote:
But making a computer count from 0-4 billion seems rather pointless.
That reminds me of the time I had two computers: a Commodore 64 (which had a clock speed of 1.02 MHz), and a 12 MHz AT-Compatible PC. I used to code up identical (sorting) programs in basic and watch them run. Yes it was pointless, and I never understood why the C64 never won at least a few times! It just didn't seem fair.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Unless you actually needed them for something, there are 232 possible addresses, but not all of those are valid. Assuming each address is 15 bytes, you could store 13,981,013 within a 200MB file.
However, since an IP address is also a 32-bit value, you could store it as a 32-bit value instead. Now that 200MB file can store 52,428,800 addresses.
for (unsigned int x = 0; x < UINT_MAX; x++)
fwrite(&x, sizeof(x), 1, ...);
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Hi, i want an article about memory allocation. What the best way to allocate memory in:
1. COM+;
2. COM;
3. Multithread enviroment ( COM e COM+);
5. i should use new and delete when ? heap ? malloc ?;
6. console aplication;
7. C and C++.
thanks for help.
|
|
|
|
|
Hi all ..
How i can convert string "arabic" to UCS-2 encoding ?
Best Regards,
Rasha
|
|
|
|
|
|
no i am going to use Unicode character-coding where each char stored in 2 byte so i load my string like that :
wchar_t * pwszMyString = "This is my wide character string";
then if i am going to use MultiByteToWideChar() which code page i have to use to convert the string to UCS2 coding ?
|
|
|
|
|
|
ok until now i got the UCS-2 then how i can get the hex representation for each charachter in 2 byte ,, like
A
|
00 61
i tride that for english it works but in arabic like
ب
|
06 28 ( the right value i should have )
insted of this value i am getting
00 C8
this mean it keep using 1 byte as i think ? what is the logic i can use to get the correct value?
|
|
|
|
|
allocator is abstract to me,how do you understand it?please explain some for it,thanks
in addition,please look:(1) list<int> c1;
(2) list<int> c2(5,3);
(3) list<int> c3(3,1,c2.get_allocator());
my question:
A.(1) and (2) use the default allocator to construct list?
B. if A is yes,then (3) still use the default allocator only chaging a showing form.
C.if A,B are yes,then only we ourselves define allocator ,that way,if write get_allocator is really useful.
if i said above has wrong ,please rectify,thx!
|
|
|
|