|
Hi all,
in my sdi application i m using non dockable toolbar.
but the doted edge displayed on the left side of toolbar.
please tell me how can i remove this.
thanks in advance.
|
|
|
|
|
|
can someone give me a pointer/example how to integrate C code in a MFC C++ project
the C code (and object code) is not seen by the MFC project.
the C++ and C work correctly independently
using MS Visual Studeo 10
thanks
steve
|
|
|
|
|
You may freely integrate C code into a MCF C++ application.
Could you please be more detailed and precise about your problem?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi iain
on the C side: ive got a MS Visual Studio project in C. It uses a simple API
on the C++ side: ive got a MS Visual Studio project in C++ MFC that I use for the user GUI
I put the C header files in the C++ code using the extern "C" {...
there are two problems
1) I tried putting the C code in the VS MFC project... dosent work. obviously dosent compile the C code either
2) since the C code (and object code) is not there, there is a link error to the C API
C++ code call to the C xface "IRD_command_compile"
int cmd::reset_pin(void) {
sequence_number current_sequence_number;
int sequence_number = current_sequence_number.load_and_inc_Sequence_Number();
return IRD_command_compile(sequence_number,command_List_lib[RESET_PIN],NULL,NULL,&cmd_segment,EMM_payload_size);
}
thanks
steve
|
|
|
|
|
I'm Carlo, not Iain (neither Alfonso...).
Stevefigo2 wrote: I put the C header files in the C++ code using the extern "C" {...
You shouldn't need this.
Stevefigo2 wrote: there are two problems
1) I tried putting the C code in the VS MFC project... dosent work. obviously dosent compile the C code either
2) since the C code (and object code) is not there, there is a link error to the C API
"Doesn't work" isn't much descriptive. What are the issues?
Stevefigo2 wrote: C++ code call to the C xface "IRD_command_compile"
What is this?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi Carlo.. (sorry about that)
Ill try to be more descripive
1) I tried putting the C code in the VS MFC project using "add existing item" under the project properties... the VS MFC refuses to add the .c files. they should be displayed under the "Solution Explorer" tab, in the project name/"source files" folder. Since the .c files are not part of the project there is no compliation and no link
the "IRD_command_compile" is the C API call in the C++ code. something really simple.
thanks for the help
steve
|
|
|
|
|
I just made I test, adding a silly C file (and corrensponding header) to an existing MFC project. Visual Studio's 'add new item' worked fine (though I had to disable 'Precompiled Header' in project properties in order to make it compile).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
if your c code is just ansi c, you may not be having any problems while integrating.
If u can Dream... U can do it
|
|
|
|
|
If you have the source, just drop them in the project. I've done this with legacy projects many times. I actually prefer to rename them to .CPP files so I can take advantage of some of the things of C++.
In reference to your above comment, I'm mystified why it doesn't work. I don't believe VS 2010 has such a restriction, though there may be an obscure setting for the .C files. (I just remembered: you can force the .C files to be compiled as C++. Perhaps they are by default.)
|
|
|
|
|
|
Hello Friends
I have to copy BitmapData to Byte Array,So i am using memcpy but my bytre array is coming null.Is there any other option?
BitmapData bmpData;
bmpImage.LockBits(rect1, ImageLockModeRead, bmpImage.GetPixelFormat(),&bmpData);
int dataLen = bmpData.Stride * bmpData.Height;
BYTE * maskImageRGBData;
maskImageRGBData = new BYTE[dataLen];
memcpy(maskImageRGBData,bmpData.Scan0,dataLen);
Any Ideas Guys?
Regards
Yogesh
|
|
|
|
|
what you mean by "byte array coming as null" ? new BYTE[dataLen] returned null ?
If u can Dream... U can do it
|
|
|
|
|
After Memcpy byte Array maskIMageRGBData coming Null.
Any Ideas?
|
|
|
|
|
you code looks innocent to me. what is the size of image you are using ? try changing the data length in memcpy to arbitary small number(say just 3 bytes ) , so that you can find where the problem resides.
example from msdn
http://msdn.microsoft.com/en-us/library/ms536298(v=vs.85).aspx[^]
hopes this helps
If u can Dream... U can do it
|
|
|
|
|
I tried by some small number but still after copying it is showing Null
Regards
Yogesh
|
|
|
|
|
There's no need to find an alternative to memcpy , since that function works fine.
Are you sure that maskImageRGBData array size is correct (see, for instance, this MSDN code sample: "LockBits Method"[^])?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Yes,cPillani.Array size is Corrrect tht is bmpData.Stride*bmpData.Height .but stil maskImageRGBData coming Null.
Regards
Yogesh
|
|
|
|
|
You may try to inspect original data (the bits locked). See the linked MSDN code sample.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
hi carlo
it was a combo of the precompiled header and the locked bits. compiles and works now
thanks for your time
peace and love
steve
|
|
|
|
|
You are welcome.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I inspect the data of BitmapData by using some mEssageBox and Its coming fine,the only thing is memcpy is not copying it to byte array.
Any Ideas?
Regards
Yogesh
|
|
|
|
|
OK, just put a loop over there( instead of memcpy ) and try . waiting for your results.
If u can Dream... U can do it
|
|
|
|
|
I tried by putting loop and all vaues are coming fine from BitmapData.
BitmapData bmpData;
bmpImage.LockBits(rect1, ImageLockModeRead, PixelFormat32bppARGB,&bmpData);
int dataLen = bmpData.Stride * bmpData.Height;
UINT* pixels = (UINT*)bmpData.Scan0;
char mysel[20];
for(UINT row = 0; row < 3; ++row)
{
for(UINT col = 0; col < 5; ++col)
{
sprintf(mysel,"%x\n", pixels[row * bmpData.Stride / 4 + col]);
}
}
Regards
Yogesh
|
|
|
|
|
i found it very strange. I can help if you if i could see the other parts below and above it. As of now i am also clueless on this.
If u can Dream... U can do it
|
|
|
|