|
Thanks, I've used the first link (you had given me) to my project and it works I can write/read commands to CMD.exe by clicking buttons :]. All I've to do now is to prepare appropriate commands, and I think, I'll be able to use the application, that I'd mentioned in my question. that's great thanks again for your reply :]
|
|
|
|
|
Hi,
I'm encountering a problem with my ActiveX control. This control needs to be visible throughout the life of the application because of a Client/Server relationship.
I'm using a View type of application. Currently, I'm getting an ASSERTion error from winocc.cpp, line 345. After doing some research, this error is seemingly caused by attempting to instantiate an ActiveX control without really adding the control to an instance form.
Currently, I've created a member var in my App class that is public.
Such as:
CClient m_conn.
However, that is clearly not enough to invoke the object correctly. I'm now under the impression that the control needs to be on a form. My problem is I do not know what form to place this control on.
So, I ask CodeProject: What form should I place my ActiveX control on in order to make it visible to the entire application throughout the application's life-time?
Do I have to make a dummy form, such as initclientdlg; then, instantiate the dialog but never call DoModal() or whathaveyou?
Thank you in advance.
|
|
|
|
|
hi all
i would like to know how can v delete a folder that contains files.i have an application which will create some files with 'xyz' extension into a diectory while clicking a button. i know only file extensions but no file names.while exiting the application i want to delete the direcory with that files.. i know we can find files & then we can deletefile function & finnaly we can delete directory. is it possible to use FindFirstFile by providing folder path & extension instead of file name. please give me replay....
|
|
|
|
|
|
hi
thanx for ur replay. can u explain the SHFileOperation as it required the file names. but i dont know the names of files which are created in my folder that i want to delete.
|
|
|
|
|
|
How does one open a Bitmap image. I am working on the VC++ platform for my project
|
|
|
|
|
give more details about wat you already have please
have you search for some examples at first ?
|
|
|
|
|
what about LoadImage ?
with something like ?
HBITMAP hBitmap = (HBITMAP)::LoadImage(NULL, sFileName, IMAGE_BITMAP,
0, 0, LR_LOADFROMFILE | LR_DEFAULTSIZE | LR_CREATEDIBSECTION);
|
|
|
|
|
Yes, dats wat i wanted.
Sorry, couldnt specify details.
Need to load bitmaps, calculate pixels n colors...
Wat wud be the best model for colors, preferably, ARGB?
|
|
|
|
|
And see CImage class if you want to open other formats
|
|
|
|
|
could anyone plz tell me how can i intialized
unsigned short int test_array[256][256] to zero or empty
Thanks!
|
|
|
|
|
Brutal method:
for (int i = 0; i < 256; i++) {
for (int j = 0; j < 256; j++) {
test_array[i][j] = 0;
}
}
wiser one:
::memset(test_array, 0, sizeof(unsigned short int)*256*256);
[edit]
-- modified at 12:08 Thursday 15th February, 2007
Better one:
unsigned short int test_array[256][256] = {0};
thanks David
[/edit]
|
|
|
|
|
toxcct wrote: wiser one:
::memset(test_array, 0, sizeof(int)*256*256);
Which would actually not be very wise as an int is twice as large as an unsigned short .
memset(test_array, 0, sizeof(test_array));
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
i'm really confused, i read int at first, not unsigned short int
by the way, i prefer writing the explicit
sizeof(unsigned short int)*256*256 instead of
sizeof(test_array) because i find it more clear in the reader's mind.
of course, if the array change of type, my code must be adapted, not yours.
|
|
|
|
|
::memset(test_array, 0, sizeof(int)*256*256);
thanks but how can be done in C langauge.
|
|
|
|
|
firstly, check the code, it's been modified (with unsigned short int instead of int in the sizeof() )
secondly, the code is quite C. remove :: before the memset, and all the remaining is C code.
don't forget however to #include <stdlib.h>
|
|
|
|
|
unsigned short int test_array[256][256] = { 0 };
memset(test_array,0,sizeof(test_array)); If you need to clear the array sometime after it's definition.
Software Zen: delete this;
|
|
|
|
|
you didn't read the other posts in the thread, did you ?
here[^] is what i told David about this...
|
|
|
|
|
ikbahrian wrote: could anyone plz tell me how can i intialized
unsigned short int test_array[256][256] to zero or empty
Like:
unsigned short test_array[256][256] = {0};
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
DavidCrow wrote: unsigned short test_array[256][256] = {0};
does this set all the array cells to 0, or only the 1st one ? I have a doubt
|
|
|
|
|
toxcct wrote: does this set all the array cells to 0...
Yes, that's what the REP STOSD instruction is for.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
|
STOre String Doubleword.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
toxcct wrote: does this set all the array cells to 0, or only the 1st one ? I have a doubt
"If a class has a constructor, arrays of that class are initialized by a constructor. If there are
fewer items in the initializer list than elements in the array, the default constructor is used
for the remaining elements. If no default constructor is defined for the class, the initializer
list must be complete — that is, there must be one initializer for each element in the array."
But why doesn't this use the "default constructor" ...
unsigned short test;
Great job, team. Head back to base for debriefing and cocktails.
|
|
|
|