|
How you are refering or Declaring the variable gC for a.exe and c.lib ?
|
|
|
|
|
I define int gC in a cpp file in the static library project.
In b.dll and a.exe, when I want to use gC, I use extern int gC ;
|
|
|
|
|
code_discuss wrote: found that the address of gC is different in a.exe between in b.dll.
Is it strange?
No, because the individual modules get their own personal instance of the variable.
Two of the possible solutions are
1) Put the common static library code in a DLL instead.
2) Use conditional compilation to only create the variable in on module (i.e. in the DLL module only)
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi all,
I am want to create Editor window in my application using MFC.
Please help how to start with this.
It include feautures like inserting break points and highligting it.
I am using Visual Studio 2005 environment.
Regards
Suhi
|
|
|
|
|
Well, that's a rather vague question. Please take a look at the posting guidelines at the top of this forum.
It all depends of what you knows. If you are new to MFC, then I strongly suggest reading a good book on the subject. If you know MFC, then you should ask a more precise question.
|
|
|
|
|
I think you can find articles on the codeproject about it.
|
|
|
|
|
hi!
I have an MFC application which is taking i/p from mouse,
when i put this application on the Tablet PC, as
input device is stylus this application doesn't work, while
other applications works properly,
what changes i need to do in the application, suggest any
tutorials that could help me out.
|
|
|
|
|
|
how to render32 bit bmp with alpha chanel on devicecontext
Trioum
|
|
|
|
|
You can use the AlphaBlend() function...
Here's an example:
LONG lImageWidth = 640;
LONG lImageHeight = 480;
WORD wBitsPerPixel = 32;
LONG lBytesPerRow = lImageWidth * 4;
BYTE* pBitmapBits;
BITMAPINFO bmi;
memset(&bmi, 0, sizeof(BITMAPINFO));
bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
bmi.bmiHeader.biWidth = lImageWidth;
bmi.bmiHeader.biHeight = lImageHeight;
bmi.bmiHeader.biPlanes = 1;
bmi.bmiHeader.biBitCount = wBitsPerPixel;
bmi.bmiHeader.biCompression = BI_RGB;
bmi.bmiHeader.biSizeImage = lBytesPerRow * lImageHeight;
HDC hdc = ::CreateCompatibleDC(0);
HBITMAP hBitmap = ::CreateDIBSection(hdc, &bmi, DIB_RGB_COLORS, (void**)&pBitmapBits, NULL, 0);
if (hBitmap)
{
<font color="Green">
RGBQUAD *pCurPixel = (RGBQUAD *)pBitmapBits;
int PixelCount = lImageWidth * lImageHeight;
while (PixelCount > 0)
{
(*pCurPixel).rgbRed = 0x00;
(*pCurPixel).rgbGreen = 0x00;
(*pCurPixel).rgbBlue = 0xA0;
(*pCurPixel).rgbReserved = 0x80; <font color="Green">
pCurPixel++;
PixelCount--;
}
HGDIOBJ hOldBitmap = ::SelectObject(hdc, hBitmap);
HDC hClientDC = ::GetDC(*this);
HPEN hPen = ::CreatePen(PS_SOLID, 10, RGB(255,0,128));
HGDIOBJ hOldPen = ::SelectObject(hClientDC, hPen);
::MoveToEx(hClientDC, 0, 0, NULL);
::LineTo(hClientDC, 650, 490);
::SelectObject(hClientDC, hOldPen);
::DeleteObject(hPen);
BLENDFUNCTION bf;
bf.BlendOp = AC_SRC_OVER;
bf.BlendFlags = 0;
bf.SourceConstantAlpha = 0xFF;
bf.AlphaFormat = AC_SRC_ALPHA;
::AlphaBlend(hClientDC, 0, 0, lImageWidth, lImageHeight,
hdc, 0, 0, lImageWidth, lImageHeight, bf);
::ReleaseDC(*this, hClientDC);
::SelectObject(hdc, hOldBitmap);
::DeleteObject(hBitmap);
}
::DeleteDC(hdc);
Using GDI+ it's easier
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I am use both code using GDI and GDI+ but alpha channel portion of image
appeared as white
Trioum
|
|
|
|
|
Then you're doing something wrong. Without seeing code it's hard to guess
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Did you use of CImage class?
|
|
|
|
|
<br />
LPBYTE p = new BYTE[1024];<br />
How can swap p into virtual memory?
modified on Wednesday, April 2, 2008 2:41 AM
|
|
|
|
|
Good news, it is already inside it.
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
|
|
|
|
|
|
http://en.wikipedia.org/wiki/Virtual_memory[^]
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
|
|
|
|
|
Hi,
I am looking for ways to display RSSI status for wireless connection (basically vertical bars with increasing height). I am looking to see if microsoft provides me an ActiveX control (like a progress bar) to display the signal strength on inputting a value in a range. Please let me know if you know if this is available or a way to implement this using VC++.
Thanks!
-A
|
|
|
|
|
abupriabi@yahoo.com wrote: control (like a progress bar) to display the signal strength on inputting a value in a range. Please let me know if you know if this is available or a way to implement this using VC++.
Take a look at CDC::FillRect Should work.
led mike
|
|
|
|
|
abupriabi@yahoo.com wrote: I am looking to see if microsoft provides me an ActiveX control (like a progress bar) to display the signal strength on inputting a value in a range.
Why do you need an ActiveX control for the above?
Don't you like the standard progress bar control?
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
|
|
|
|
|
CPallini wrote: Why do you need an ActiveX control for the above?
Don't you like the standard progress bar control?
In standard progress bar all the bars are of the same height. I want a control wherein the height of the bars are increasing: Like the signal strength indicator on cell phone.
|
|
|
|
|
CP search engine makes the magic happen [^]
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
|
|
|
|
|
hi
how can i reverse a vertical slider (min at bottom max at top)
"i know there are lots of math functions for reverse it"
i tried TBS_DOWNISLEFT but nothing was happen
this is a VC++ 6.0 project and i.m updating/Compiling it
with VS .NET 2003 it compiles without error but slider seems normal
i am creating it with
CSliderCtrl *m_slider;
m_slider->CreateEx()
at runtime
and a second question
is there any way to set visible or invisible
slider's (standard)tooltip at runtime(after created)
thanks
|
|
|
|
|
Have you tried the SetRange() method?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
DAVID! Stop passing out those secret documented methods!
led mike
|
|
|
|