|
How do I set up project wide settings. All of my sub-projects need to access the same #include paths. Can I set this up somewhere for solution instead of every project
Same question for pre-processor defines. where do I set up some constants to be used by every project?
ES
|
|
|
|
|
Open Property Manager.
View -> Other Windows -> Property Manager
Expand the project and the configuration.
Right click on Microsoft.Cpp.Win32.user and select Properties .
What ever changes you make here will globally effect that particular configuration.
|
|
|
|
|
my code is below:
g_hIconImageList = ImageList_Create(18, 17, ILC_COLOR16, 7, 10);
hBitMap = LoadBitmap(hInst,MAKEINTRESOURCE(nIconImageID));
ImageList_Add(g_hIconImageList, hBitMap, NULL);
DeleteObject(hBitMap);
TreeView_SetImageList(g_hTreeViewHandle, g_hIconImageList, TVSIL_NORMAL);
......
if(g_hCheckBoxImageList != NULL)
{
ImageList_Destroy(g_hCheckBoxImageList);
g_hCheckBoxImageList = NULL;
}
I detect 4 GDI leaked. Only TVSIL_NORMAL will cause GDI leak not TVSIL_STATE.
I change my code by http://www.codeproject.com/Messages/2125713/Re-GDI-Leak-in-CTreeCtrl-with-TVS_CHECKBOXES-prope.aspx[^], but it does't work.
|
|
|
|
|
Resolve:http://support.microsoft.com/kb/228859
|
|
|
|
|
HI Gurus,
Iam invoking my server from batch file.
Iam trying to run six projects sequentially, But After three projects executed successfully, Windows Exception coming.
Some times for every project Windows Exception coming.
my Batch file is like this.
DUCommandLine.exe -u sa -a sa -p DB2DB1 -s Rayalu -n 10
DUCommandLine.exe -u sa -a sa -p DB2DB2 -s Rayalu -n 10
DUCommandLine.exe -u sa -a sa -p DB2DB3 -s Rayalu -n 10
DUCommandLine.exe -u sa -a sa -p DB2DB4 -s Rayalu -n 10
DUCommandLine.exe -u sa -a sa -p DB2DB5 -s Rayalu -n 10
Individual projects iam able to run successfully.
Can i get return value after execution of each project.
Please guide me to fix this problem.
Thanks,
Krishna
|
|
|
|
|
Test the errorlevel[^] after each command to decide whether to continue. Your application should set this value in its exit() call or the return value from main() . You should also catch any exceptions and print a meaningful message to assist in diagnosing the problem.
It's time for a new signature.
|
|
|
|
|
use for every instance an new console. "CALL ..."
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
HI Gurus,
it is Throwing DOS Error code 1073741819
After finishing third Project.
If i run 5 projects in 5 batch files then Individually all projects running successfully.
Thanks
Krishna
|
|
|
|
|
do you know that you can enter "help" in a dos window.
The right command ist "START ..."
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
Hi,
I have picture control in dailog.Im loading image in OnPaint() for that picture control.And i have If else condition,depends on i will change the bitmap.
But what happened is when i invoke Dialog,immediately i can see image like a blink.thatsall .then it goes.I dont know what happened.
And also apart from this problem.The dailog get flickering continously.I have edit control,combox in dialog.Im putting values in all controls in OnPaint().
BOOL CFacePlate::OnInitDialog()
{
CDialog::OnInitDialog();
Bmp1.LoadBitmap(IDB_PVHIGH);
Bmp2.LoadBitmap(IDB_PVLOW);
}
void CFacePlate::OnPaint()
{
CPaintDC dc(this);
m_fPV = oTagBase->GetPV();
m_fSP = oTagBase->GetSV();
if(pv>=oTagBase->GetAlarmHigh())
{
m_Picture.SetBitmap(Bmp1);
}
else
{
m_Picture.SetBitmap(Bmp2);
}
}
Anu
|
|
|
|
|
OnPaint is probably the wrong place to do this - I don't know what control you're using but from my experience with STATIC controls if you send STM_SETIMAGE it invalidates the client area of the control. If your control works the same way then...
- something invalidates the window
- it loads the bitmap
- the STM_SETIMAGE invalidates the window
- it loads the bitmap
- ... ad nauseum
Actually it's in a loop, not an infinite recursion but I hope you get the idea. A better approach would be to isolate the selection of the bitmaps into the control into another message and send that when the stimulus to change the bitmap occurs. This is essentially the basis of the observer pattern.
Cheers,
Ash
|
|
|
|
|
In addition do comment by Ash. Move
if(pv>=oTagBase->GetAlarmHigh())
{
m_Picture.SetBitmap(Bmp1);
}
else
{
m_Picture.SetBitmap(Bmp2);
}
to a separate function, e.g. SetImages() and call this from OnInitDialog. Modify SetImages() to only call SetBitmap if the image actually changed since last call.
Then if possible add an event handler listening for changes in the alarm. If you have no such mechanism implemented you could poll the alarm value using a timer.
|
|
|
|
|
m_Picture.SetBitmap(Bmp1) isnt drawing the pic i guess by not taking the dc as param.
i miss something like
Picture.Draw(dc);
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
You should set the bitmap only when needed, for instance
void CFacePlate::OnPaint()
{
static bool wasAlarmHigh = false;
bool isAlarmHigh = pv>=oTagBase->GetAlarmHigh();
if ( isAlarmHigh != wasAlarmHigh)
{ if(isAlarmHigh)
{
m_Picture.SetBitmap(Bmp1);
}
else
{
m_Picture.SetBitmap(Bmp2);
}
wasAlarmHigh = isAlarmHigh;
}
}
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]
|
|
|
|
|
please help
i get this message when i try to build the application. please note that it was converted to visual studio 2010
error C1083: Cannot open source file: '..\..\..\..\..\Program Files\Microsoft Visual Studio\VC98\MFC\SRC\WINMAIN.CPP': No such file or directory C:\Users\Yotam Wimmer\Desktop\Scope files\Copy of ver8hSearchWholeWord\c1xx
i am not sure what the winmain.cpp is but i have found it on my system at "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\src\mfc"
how can i tell visual studio to look in that path instead of the other one. or is there another solution?
thanks,
yotam
|
|
|
|
|
You should be able to change the path to the file by either opening the .vcproj file in notepad and changing it or by clicking the file in the Solution Explorer and changing the RelativePath property in the Properties window (That's the dock-able properties window, not the one you get from right-clicking)
My current favourite quote is: Punch them in the face, see what happens!
-SK Genius
|
|
|
|
|
thanks you ,legend
|
|
|
|
|
Below are run NOTEPAD. 01001EDC place, in EXE OllyDbg interrupt results:
<br />
01001ED6 |. 8B3D 48120001 MOV EDI,DWORD PTR DS:[<&USER32.CheckMenu>; |USER32.CheckMenuItem<br />
01001EDC |. 50 PUSH EAX ; |hMenu<br />
01001EDD |. FFD7 CALL EDI ; \CheckMenuItem<br />
u can OllyDbg through the upper check into another process EAX value.
How do I use vc + + to write a program that can read the value 01001EDC EAX place?
|
|
|
|
|
I beleive you have to get a handle to the process (in this case, Notepad), and then use an API function called ReadProcessMemory
If you do a search on ReadProcessMemory you should find some examples, there were some around a while back - its not 'easy' though ..
'g'
|
|
|
|
|
Can you explain what you're trying to do more clearly? I'm not sure what you're asking.
Steve
|
|
|
|
|
Hi,
I am reading some image data out of a camera pixels and have extracted the raw pixel intensity. Each "pixel" on the Camera sensor has either a R,G, or B filter that gives the intensity of the 'R', 'G', or 'B' 'pixel'. I read this data and then extract and store the individual R, G, or B pixel intensities into 3 separate 2d unsigned char arrays called m_ptrRed2DPostDecimationArray. m_ptrGreen2DPostDecimationArray, and m_ptrBlue2DPostDecimationArray. Now I can use SetPixel to display the extracted R, G, and B in 3 separate 'R', 'G', or 'B' window areas. I can display them either in color or grayscale through:
For grayscale: dc.SetPixel(j, i, RGB(theApp.m_ptrRed2DPostDecimationArray[i][j], theApp.m_ptrRed2DPostDecimationArray[i][j], theApp.m_ptrRed2DPostDecimationArray[i][j]));
For color: dc.SetPixel(j, i, RGB(theApp.m_ptrRed2DPostDecimationArray[i][j], 0, 0));
However, I realize SetPixel is very ineffecient so looking at other ways to display. I only need the 8 bit grayscale image so was hoping that I could achieve it using CreateBitmap. m_ptrRed2DPostDecimationArray is a BYTE array (actually unsigned char) that holds the 8 bit raw pixel intensities from the camera pixels that have a red filter on them. Here is my current code (that does not work):
void CVC_ExampleDlg::OnPaint()
{
CDC *pDC = GetDC();
BOOL retval = m_redBitmap.CreateBitmap(600, 200, 1, 8, theApp.m_ptrRed2DPostDecimationArray);
CDC memDC;
memDC.CreateCompatibleDC(pDC);
memDC.SelectObject(&m_redBitmap);
retVal = pDC->BitBlt(0, 0, 600, 200, &memDC, 0, 0, SRCCOPY);
memDC.DeleteDC();
ReleaseDC(pDC);
CDialog::OnPaint();
}
Now I know I can create a grayscale palette and use the raw data as an index to that palette but it seems to me that CreateBitmap has that built in functionality. I mean it seems like that when I give it 1 color plane and 8bpp, it should automatically create a grayscale 8bit bitmap, no?
Can anyone see what I'm doing wrong. I mean all I want is that I already have the pixel intensity from 0-255 (8 bit) in a byte array. Since I just only want a grayscale bitmap, creating a grayscale palette and indexing it seems overkill especially when CreateBitmap seems to (theoretically) encapsulate that functionality.
I guess, if my question is clear enough, what is the easiet and/or most efficiect way to create a 8bit grayscale image from the raw pixel intensity value from 0-255?
Thank you,
-Vivek Kinra
|
|
|
|
|
You should be looking at creating a DIB using CreatDIBSection() and SetDIBits() .
This may help CDibData[^]
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence." - Edsger Dijkstra
"I have never been lost, but I will admit to being confused for several weeks. " - Daniel Boone
|
|
|
|
|
Thanks Jon..but really, why is it that CreateBitmap doesn't work? I mean based on its documentation it should right?
I'm trying to do this the simple way and I suspect that there is built in functionality to take raw pixel intensity data and create a 8bit grayscale bitmap without explicitly creating a grayscale palette and using the raw pixel data as indices to that palette right?
I mean it seems fairly basic to simply take intensity data that is from 0-255 and drawing that as a grayscale bitmap.
-V
|
|
|
|
|
It has been a long time, but the problem could be as simple as word alignment. The length of each scan line must be divisible by 4. That is, each line must be padded with zeros if it is not already word aligned.
Example: (assuming single-byte per pixel)
wrong_data[2][1] = {
{0x00},
{0xFF}
};
correct_data[2][4] = {
{0x00, 0x00, 0x00, 0x00},
{0xFF, 0x00, 0x00, 0x00}
};
I have not tested the above, but it looks right.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence." - Edsger Dijkstra
"I have never been lost, but I will admit to being confused for several weeks. " - Daniel Boone
|
|
|
|
|
I always thought I had a good grip on short circuit evaluation for Logical AND and Logical OR but I'm mixing the two and the results are not intuitive. The specification does not suggest the behavior I'm seeing with VC++ 2003 so I thought I'd post the test and results and see if anyone can tell me why "Eval3" never gets evaluated.
void Test()
{
if (Eval1() || Eval2() && Eval3()) {
TRACE("Result = TRUE\n");
} else {
TRACE("Result = FALSE\n");
}
}
BOOL Eval1(void)
{
TRACE("Eval1\n");
return TRUE;
}
BOOL Eval2(void)
{
TRACE("Eval2\n");
return TRUE;
}
BOOL Eval3(void)
{
TRACE("Eval3\n");
return FALSE;
}
Output:
Eval1
Result = TRUE
|
|
|
|