|
|
No you dont need to install MySql server in your PC. I will recommend using MySql++[^].
-Saurabh
|
|
|
|
|
Hi
i have a win32 console application. i need to use an activeX control in my project.
but my project have problem in execution. in calling Create function
COcxClass objmyActivX;
CWnd cw;
objmyActivX.Create(NULL, NULL, CRect(0,0,0,0),cw.FindWindow(NULL,NULL), 0);
my project is a service and i don't need any dialog or window in my project.
please help me
Zo.Naderi-Iran
|
|
|
|
|
Your code declares objmyActivX and cw and then tries to use them before either of them has been initialised to a value.
|
|
|
|
|
the objmyActivX will be initialize with calling Create function.
do i initialize with what value the cw?
Zo.Naderi-Iran
|
|
|
|
|
zon_cpp wrote: the objmyActivX will be initialize with calling Create function.
Not true I'm afraid. You are trying to invoke the Create() method on the objmyActivX object, which has no value. It would appear that you need to spend some time understanding C++ and whatever functionality you are trying to use here.
zon_cpp wrote: do i initialize with what value the cw?
I presume from its declaration this is some window belonging to the application but I don't really understand how this fits in to what you are attempting.
|
|
|
|
|
my project is a win32 console application !!!
in a dialog base project, this code has not any problem. but in win32 console project (win32 console) ...!
i think, the fourth paramet of create funtion is incorrect. but, what is it , the correct of this parameter ?
Zo.Naderi-Iran
|
|
|
|
|
If you had done a search on Google first you could have found this article[^].
|
|
|
|
|
thank you very much.
my time, for this problem, is very few. you helped me, thanks.
and this article: Getting the most out of IDispatch[^], solved my problem.
Zo.Naderi-Iran
|
|
|
|
|
What's wrong with my code to load an image from a file? It doesn't seem to work. Or is it the code to make it into an HDC that causes the problem?
HBITMAP LoadBitmapFromFile(LPCTSTR szFilename)
{
HBITMAP hBitmap = NULL;
hBitmap = (HBITMAP)LoadImage(NULL, szFilename, IMAGE_BITMAP, 0, 0,
LR_LOADFROMFILE | LR_CREATEDIBSECTION | LR_DEFAULTSIZE);
return hBitmap;
}
HDC userNewHDC;
HBITMAP userNewBitmap;
userNewBitmap = LoadBitmapFromFile("C:\imagefile.bmp");
userNewHDC = CreateCompatibleDC(NULL);
SelectObject(userNewHDC,userNewBitmap);
I then BitBlt the userNewHDC object but it doesn't seem to work. Whats wrong?
|
|
|
|
|
You should check the return values and the error codes using GetLastError() .
|
|
|
|
|
Try using the Debugger to see if LoadBitmapFromFile returns NULL or a valid handle.
You can than use GetLastError() to see what went wrong.
Looking at your code I would say you should change:
userNewBitmap = LoadBitmapFromFile("C:\imagefile.bmp")
to:
userNewBitmap = LoadBitmapFromFile("C:\\imagefile.bmp");
|
|
|
|
|
Omnicoder wrote: It doesn't seem to work.
How are you verifying this?
"One man's wage rise is another man's price increase." - Harold Wilson
"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
|
|
|
|
|
hi every body,
is it possible to handle voice speech recognizable and saving option in vc++6.0
please help me..
thanks in advance
|
|
|
|
|
Not possible in VC++6.0 unless you install and use SAPI, Just refer [^]
Величие не Бога может быть недооценена.
|
|
|
|
|
Hi,
I utilize Visual C++ 2003 and MFC with document/view architecture..
I want to respond differently when I choose Print from the menu and the Print button from the toolbar. The reason is that I want to select the file to print when I choose from the menu, and I want to print directly the open file when I choose from the Print toolbar button.
How can I do that ?
Thanks,
Claude
|
|
|
|
|
Gagnon Claude wrote: I want to respond differently when I choose Print from the menu and the Print button from the toolbar.
Connect them to different triggers.
|
|
|
|
|
I want to draw menu without the shadow frame, but i don't know how to deal with the frame of the menu. I searched but only found one project Professional User Interface Suite[^] implemented this. But, the project is so huge, so, i almost can't find how it reaches its aim.
Any ideas will be very appreciated.
Regards
|
|
|
|
|
Hi all,
using System.Net.WebClient().DownloadFile we can download the files from web in C#.
How to incorporate these functionalities in WIN32 C++ projects
i am using Microsoft Visual C++ 6.0
Thanks in advance
|
|
|
|
|
|
|
You can use the Windows API: UrlDownloadToFileA or UrlDownloadToFileW .
|
|
|
|
|
#include <windows.h>
#include <stdio.h>
#include <math.h>
#include <gl\glew.h>
#include <gl\gl.h>
#include <gl\glut.h>
static GLfloat f1,f2,f3;
static void initA(void)
{
GLfloat fogColor[4]={0.0,0.25,0.25,1.0};
f1=1.0f;
f2=5.0f;
f3=10.0f;
glEnable(GL_FOG);
glFogi(GL_FOG_MODE,GL_EXP);
glFogfv(GL_FOG_COLOR,fogColor);
glFogf(GL_FOG_DENSITY,0.25);
glHint(GL_FOG_HINT,GL_DONT_CARE);
glFogi(GL_FOG_COORDINATE_SOURCE_EXT,GL_FOG_COORDINATE_EXT);
glClearColor(0.0,0.25,0.25,1.0);
}
void displayA(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(1.0,0.75,0.0);
glBegin(GL_TRIANGLES);
glFogCoordfEXT(f1);
glVertex3f(0.2f,0.2f,0.0f);
glFogCoordfEXT(f2);
glVertex3f(-0.2f,0.0f,-0.5f);
glFogCoordfEXT(f3);
glVertex3f(0.0f,0.2f,-1.0f);
glEnd();
glutSwapBuffers();
}
void reshapeA(int w,int h)
{
glViewport(0,0,(GLint)w,(GLint)h);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(45.0,1.0,0.25,25.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTranslatef(0.0,0.0,-5.0);
}
void keyboardA(unsigned char key,int x,int y)
{
switch(key)
{
case 'c':
glFogi(GL_FOG_COORDINATE_SOURCE_EXT,GL_FRAGMENT_DEPTH);
glutPostRedisplay();
break;
case 'C':
glFogi(GL_FOG_COORDINATE_SOURCE_EXT,GL_FOG_COORDINATE);
glutPostRedisplay();
break;
case '1':
f1=f1+0.25;
glutPostRedisplay();
break;
case '2':
f2=f2+0.25;
glutPostRedisplay();
break;
case '3':
f3=f3+0.25;
glutPostRedisplay();
break;
case '8':
if(f1&amp;amp;amp;amp;amp;gt;0.25)
{
f1=f1-0.25;
glutPostRedisplay();
}
break;
case '9':
if(f2&amp;amp;amp;amp;amp;gt;0.25)
{
f2=f2-0.25;
glutPostRedisplay();
}
break;
case '0':
if(f3&amp;amp;amp;amp;amp;gt;0.25)
{
f3=f3-0.25;
glutPostRedisplay();
}
break;
case 'b':
glMatrixMode(GL_MODELVIEW);
glTranslatef(0.0,0.0,-0.25);
glutPostRedisplay();
break;
case 'f':
glMatrixMode(GL_MODELVIEW);
glTranslatef(0.0,0.0,0.25);
glutPostRedisplay();
break;
case 27:
exit(0);
break;
default:
break;
}
}
int main(int argc,char** argv)
{
glutInit(&amp;amp;amp;amp;amp;amp;argc,argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB);
glutInitWindowSize(400,400);
glutCreateWindow("Fog effect Demo");
initA();
glutReshapeFunc(reshapeA);
glutKeyboardFunc(keyboardA);
glutDisplayFunc(displayA);
glutMainLoop();
return 0;
}
The code can be impiled,but it can not run. when it runs, the operate system give an exception message.I use vc6.0 as a tool.
modified on Tuesday, November 24, 2009 4:02 AM
|
|
|
|
|
Is there a question in there somewhere?
You measure democracy by the freedom it gives its dissidents, not the freedom it gives its assimilated conformists.
|
|
|
|
|
Yes,it can not run. There is an abnormal essage.
|
|
|
|