|
Code-o-mat wrote: As i said
Yes you did. My fault, I read your post the first time and missed that part. Unfortunately there might not be another way to do it.
|
|
|
|
|
Oh well, i'll go with what i can get, i was just hoping for a more sophisticated way to do it. Thanks.
> 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, i will check if i can use any of that, the project is not an MDI app but an SDI one with a few floating windows and i want one modeless dialog to stay above all the floats.
> 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. <
|
|
|
|
|
Then you probably want to check out the SetWindowPos flag WS_EX_TOPMOST
|
|
|
|
|
The problem with WS_EX_TOPMOST is that it will make the window "globally" always on top, menaing it will cover all non-always-on-top windows on the system but i only want it to cover the windows of itw own process.
> 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 every one.
I have used 'NTGraph3D.dll' from [3D Graph ActiveX Control] with out any problem,
But When I want to compile the source using Visula Studio 2008 SP1 the below error occurred!
GraphCtl.obj : error LNK2019: unresolved external symbol "char * __stdcall _com_util::ConvertBSTRToString(wchar_t *)" (?ConvertBSTRToString@_com_util@@YGPADPA_W@Z) referenced in function "public: void __thiscall CGraphCtl::DrawAxisLabels(struct HDC__ *)" (?DrawAxisLabels@CGraphCtl@@QAEXPAUHDC__@@@Z)
.\Debug/NTGraph3D.dll : fatal error LNK1120: 1 unresolved externals
any one could help??
or how could I use the source of this control in my program
instead of ActiveX control prepared by the source.[thanks]
|
|
|
|
|
Amir_m wrote: any one could help??
Have you read 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
|
|
|
|
|
 of course, but I was confused with so much cases that generate this error,
Only I know that this function in its last 7 lines cause the error, if you cuold recognize it please tell me.
void CGraphCtl::DrawAxisLabels(HDC hdc)
{
float X,Y,Z,res;
int i;
char str[50];
CPoint3D pt;
COLORREF colX, colY, colZ;
OleTranslateColor(m_clrXGridColor, m_hPal, &colX);
OleTranslateColor(m_clrYGridColor, m_hPal, &colY);
OleTranslateColor(m_clrZGridColor, m_hPal, &colZ);
res = (dRangeX[MAX] - dRangeX[MIN]) / m_nGridX ;
for ( i = 0 ; i <= m_nGridX ; i++)
{
X = dRangeX[MIN] + (res * (float)i);
sprintf(str,"%g",X);
X = ((float)i)/m_nGridX;
SetColor(colX);
pt=CPoint3D(-0.5,-0.5,0.5);
pt.Translate(X,0.0,0.3);
PrintText(hdc, pt, str);
}
res = (dRangeY[MAX] - dRangeY[MIN]) / m_nGridY ;
for ( i = 0 ; i <= m_nGridY ; i++)
{
Y = dRangeY[MIN] + (res * (float)i) ;
sprintf(str,"%g",Y);
Y = ((float)i)/m_nGridY;
SetColor(colY);
pt = CPoint3D(-0.5,-0.5,0.5);
pt.Translate(0.0,Y,0.3);
PrintText(hdc, pt, str);
}
res = (dRangeZ[MAX] - dRangeZ[MIN]) / m_nGridZ ;
for ( i = 0 ; i <= m_nGridZ ; i++)
{
Z = dRangeZ[MIN] + (res * (float)i) ;
sprintf(str,"%g",Z);
Z = ((float)i)/m_nGridZ;
SetColor(colZ);
pt = CPoint3D(0.5,-0.5,-0.5);
pt.Translate (0.2,0.0,Z);
PrintText(hdc, pt, str);
}
SetColor(RGB(0,0,0));
using namespace _com_util;
SetColor(colX);
PrintText(hdc,CPoint3D(0.0f,0.7f,-0.5f),ConvertBSTRToString(m_bstrXLabel));
SetColor(colY);
PrintText(hdc,CPoint3D(0.7f,0.0f,-0.5f),ConvertBSTRToString(m_bstrYLabel));
SetColor(colZ);
PrintText(hdc,CPoint3D(-0.5f,0.7f,0.0f),ConvertBSTRToString(m_bstrZLabel));
glEnd();
}
[thanks]
|
|
|
|
|
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)?
|
|
|
|
|