|
Are you linking with the correct library? Have you seen this and this and this?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Thanks David The Solutions was totally nice especially the last one.
I have corrected the problem by adding the lines below (using your solutions):
#ifdef _DEBUG
# pragma comment(lib, "comsuppwd.lib")
#else
# pragma comment(lib, "comsuppw.lib")
#endif
# pragma comment(lib, "wbemuuid.lib")
By the way, now the program works fine for making ActiveX Control , Do you have any idea How to
change it to use in my program directly.
|
|
|
|
|
Hi, does anyone know how to make the crossover in a real-coded genetic algorithm? If so, can you explain this to me, thanks!
|
|
|
|
|
Hello,
There is a Genetic Algorithm Library[^] at CP that you may want to take a look at.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Thanks for the reply. What I've seen in the library tutorial about crossing real-coded chromosomes is that one makes the mean value between the values of the geans, is this so?
|
|
|
|
|
Well, I am not a genetic algorithm expert, neither do I feel like reading through that article.
But, you may very well start a new thread at discusion board at the bottom of the said article, which will have a higher chance of being replied to.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Thanks for the tip. I didn't know where to post the message, so I decided this c++ message board would be an option, but as you say it's better to post it in the other. See you!
|
|
|
|
|
Hello,
I'd like to be able to directly support exporting various reports from my MFC application. The reports are drawn to a device context using standard GDI techniques, overloading OnDraw in a view.
Ideally, there'd be a library that I could just drop in that provides a hDc that I'd draw to in the usual manner. This library would be either available under a copy-centre licence (BSD/MIT/COL) or would be commercially available.
Could someone suggest a library/approach?
Regards,
Sternocera
|
|
|
|
|
Please, let me google that for you [^].
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]
|
|
|
|
|
Hello!
Take a look at LibHaru[^]
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Rajesh,
I took a look at LibHaru, but I found that it cannot draw to a windows GDI device context...thus, I'd have to rewrite my reports from scratch.
What I'd really like is a drop-in replacement for my GDI device context.
I read somewhere that it is somehow possible to do this using WxWidgets' PDF support. I can't seem to find any more information though,
Regards,
Sternocera
|
|
|
|
|
You can always create a bitmap of the stuff that's stored on your device context and then Haru can print it to a PDF. Sounds viable?
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Rajesh,
Obviously, I'd much rather preserve my reports as vector graphics.
At the moment, I'm looking at wxPdfDocument - It's designed to be used from WxWidgets, but it may be possible to use from MFC,
Regards,
Sternocera
|
|
|
|
|
If you succeed in making it work with MFC, it must make a good article for CP.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
|
I want to implement drawing of standard listbox, treeview etc. to a layered window. I know there is a method with “fake” layered window under normal one but I need more flexible control on incorporation of standard controls to final image of a layered window.
I think there may be some hidden window with controls I need and whose drawing stuff can be redirected to some bitmap. If it's not possible with the hidden window then what about window that is out of screen (e.g. x = -2000, y = -2000)?
|
|
|
|
|
Try experimenting with WM_PRINTCLIENT[^].
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
 Thanks! It works! But there is something wrong with the alpha channel.
[img]http://smages.com/i/0c/74/0c74a1f057b9a7e17a0c27e2b4dd4766.png[/img]
I'm creating 32-bpp bitmap and asking the button do draw itself there with WM_PRINTCLIENT. What's wrong?
hdc = GetDC(hWnd);
hdcMemory = CreateCompatibleDC(hdc);
nBytesPerLine = ((szWin.cx * 32 + 31) & (~31)) >> 3;
stBmpInfoHeader.biSize = sizeof(BITMAPINFOHEADER);
stBmpInfoHeader.biWidth = szWin.cx;
stBmpInfoHeader.biHeight = szWin.cy;
stBmpInfoHeader.biPlanes = 1;
stBmpInfoHeader.biBitCount = 32;
stBmpInfoHeader.biCompression = BI_RGB;
stBmpInfoHeader.biClrUsed = 0;
stBmpInfoHeader.biSizeImage = nBytesPerLine * szWin.cy;
void* pvBits;
hbmpMem = CreateDIBSection(NULL, (PBITMAPINFO)&stBmpInfoHeader, DIB_RGB_COLORS, &pvBits, NULL, 0);
memset(pvBits, 0x88, szWin.cx * szWin.cy * 4);
if (hbmpMem)
{
HGDIOBJ hbmpOld = SelectObject(hdcMemory, hbmpMem);
SendMessage(ctrl, WM_PRINTCLIENT, (WPARAM)hdcMemory, PRF_CLIENT | PRF_CHILDREN | PRF_OWNED);
BLENDFUNCTION stBlend;
stBlend.AlphaFormat = AC_SRC_ALPHA;
stBlend.BlendFlags = 0;
stBlend.BlendOp = AC_SRC_OVER;
stBlend.SourceConstantAlpha = 255;
UpdateLayeredWindow(hWnd, hdc, &ptWinPos, &szWin, hdcMemory, &ptSrc, 0, &stBlend, ULW_ALPHA);
SelectObject(hdcMemory, hbmpOld);
DeleteObject(hbmpMem);
}
DeleteDC(hdcMemory);
DeleteDC(hdc);
|
|
|
|
|
Do you simply want to make a window that has a constant blend factor? Because if yes, then you don't need a bitmap and the fancy drawing and all the rest.
Aside of this, is your problem that the button seems to loose transparency? I supose that's simply because when the button gets drawn onto your bitmap it overwrites the alpha channel.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
I do need per-pixel alpha for some skinning engine So if control overrides alpha then I have to make one more bitmap (24 bpp) and then blit it to my 32b buffer? Or there is simpler solution?
|
|
|
|
|
How about filling the alpha channel after you rendered your controls?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Hi All,
On a TCHAR buffer I've some data. I want to check them either empty or not, the content.
I tried this.
<br />
TCHAR szMyBuffer[128];<br />
<br />
if(szMyBuffer != L"")<br />
But this is not work, what can I do on that?
Thanks a lot
I appreciate your help all the time...
CodingLover
|
|
|
|
|
You are checking the address of the buffer, you need to check the contents. Try:
if (!szMyBuffer[0])
if (szMyBuffer[0])
(Sorry for the brain freeze.)
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
It's quite the opposite (i.e. if (szMyBuffer[0]) ).
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]
|
|
|
|
|
Well, you both are right, it is a matter of "where" you handle the error. Some people go by that style, Carlo.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|