|
|
Thanks Hamid,
I think this link does not relat to my question. My question is whether or not the OLESTR variable is on stack or on heap. Any comments or ideas?
regards,
George
|
|
|
|
|
Oh I think it was my mistake.
|
|
|
|
|
It is ok, Hamid!
At least you have made us to find something new.
regards,
George
|
|
|
|
|
I glad it was al little help for you.
|
|
|
|
|
I have one static library named c.lib, in which there is a global member int gC;
Two other modules, a.exe and b.dll(regular dll using mfc), link to c.lib.
I found that the address of gC is different in a.exe between in b.dll.
Is it strange?
How can I make only one global int gC?(but used both in c.lib, b.dll, and a.exe)
|
|
|
|
|
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
|
|
|
|