|
Okay, WHY do you have to make your DLL in Dev-C++? You have VC++ so why don't you make it in VC++?
If you post your code that calls the DLL function it would be easier to help you!
Rickard Andersson8
Here is my card, contact me later!
UIN: 50302279
E-Mail: nikado@pc.nu
Interests: C++, ADO, SQL, Winsock, 0s and 1s
|
|
|
|
|
well my question really divides into two:
i wanted to save new pictures from old pictures, and add the time to them.
that's when i got to my first question:
[1] i could only save the new pics as gif and bmp, other formats gave me
invalid parameter. why? and how do i fix it?
then i thought to myself "ok, nevermind, i'll just save it as bmp, and then
open it from a new Bitmap object and save it as another format". - wow, it
actually worked, but then i got to my second question:
[2] i can't delete the temporary bmp file, since it's being used, even when
i used pointer to a bitmap and deleted it, it still couldn't delete the
file. why? and how do i fix it? (i used the DeleteFile function)
can anyone help me about these two questions, or one of them, please!
thanks
|
|
|
|
|
i create an application who should draw five(or another number) of cube with sphere ,but i have a problem with it,it just draw one sphere and one cube and i don't know what.
i has used a vector to store the sphere and the cube that i create.
<br />
<br />
#include "stdafx.h"<br />
#include "OpenGl.h"<br />
#include "creatfoufou.h"<br />
#include "foufou.h"<br />
#include <vector><br />
<br />
#include <math.h><br />
<br />
#ifdef _DEBUG<br />
#undef THIS_FILE<br />
static char THIS_FILE[]=__FILE__;<br />
#define new DEBUG_NEW<br />
#endif<br />
<br />
<br />
using namespace std;<br />
vector< foufou * > fou_caracter;<br />
<br />
<br />
creatfoufou::creatfoufou()<br />
{<br />
ptrfoufou = new foufou;<br />
<br />
<br />
}<br />
<br />
creatfoufou::~creatfoufou()<br />
{<br />
<br />
}<br />
<br />
void creatfoufou::creatfou(int amount)<br />
{<br />
foufou *newfoufouPtr;<br />
int randomX,randomY,randomZ;<br />
int speed,steer;<br />
<br />
for(int index=0;index<amount;index++)<br />
{<br />
newfoufouPtr = new foufou();<br />
fou_caracter.push_back( newfoufouPtr );<br />
randomX = ( ( 1 + rand( ) % 100 ) - 50 );<br />
randomY =( ( 1 + rand( ) % 100 ) - 50 );<br />
randomZ =( ( 1 + rand( ) % 100) - 50);<br />
<br />
setposition(randomX,randomY,randomZ);<br />
<br />
<br />
<br />
}<br />
}<br />
<br />
void creatfoufou::setposition(int newX, int newY, int newZ)<br />
{<br />
<br />
ptrfoufou->RePaint(newX,newY,newZ);<br />
}<br />
|
|
|
|
|
Do these vectors differ from each other? Check out srand /rand functions.
Regards,
BB
|
|
|
|
|
witch vector?
i will send you the project in your mail
|
|
|
|
|
|
Hello *.*!
I'm just programming a little app with MFC. I wonder if there is a simple control that took my output data but there was only the listbox. It is very sinewy to collect all chars to a single line, delete the \n \l 's an then use the AddString function to put it out.
I need to output to a control in a dialog like with printf:
printf("bla bla");
printf("blubb blah \n"); <- NOW the new line!!
and so on...
Did anyone of you have an idea to solve my problem? But I can't use the win32-console-application since I have to use MFC and dialogs!
Thanks in advance, Jan
|
|
|
|
|
A textbox could do the trick, by doing something like
txtBox->SetWindowText(txtBox->GetWindowText() + CString(_T("Some text")))
LPCTSTR Dutch = TEXT("Double Dutch ");
|
|
|
|
|
The socket on the side of server maintain a queue to save the requirements of
connection.When the socket on the side of server agreed with a requirement of connection,it formed a new socket to connect to the client.My question is that how to get the information of a client from the queue,for I want to identify each of the clients.I want to send different messages to different clients,how can I get the socket of a client from the queue?
|
|
|
|
|
You can call getpeername to get information about the client (LPSOCKADDR).
ÿFor the bread of God is he who comes down from heaven and gives life to the world. - John 6:33
|
|
|
|
|
Can you explain it in detail?thanks!
|
|
|
|
|
Another solution is getnameinfo() and save either the IP or domain name in a database.
Kuphryn
|
|
|
|
|
Please teach me in detail,thank you very much!
|
|
|
|
|
Hi all
I have an application which calls another thread with own window procedure.
Inside that another window I put edit control.
My problem is that I can not type anything inside that Edit Control.
It looks, that it does not have keyboard focus.So, I tryed to work with SetFocus(), but it did not help.
Please answer my question.
Tahnks.
Nena
|
|
|
|
|
What kind of thread does the main thread spawn? In other words, the child thread should be a UI thread if you want to update the edit control.
Kuphryn
|
|
|
|
|
hello
i declared function in one class that i creat ,public, but when i want to use it in an other class it say that's not declared.
|
|
|
|
|
Did you include the declaing header file into the callers?
Do Lipton employees get coffee breaks?
|
|
|
|
|
|
How are you using it in the other class?
Class A
{
public:
void AFunc();
}
Class B
{
void SomeBFunc();
}
void B::SomeBFunc()
{
A aInst;
aInst.AFunc();
AFunc();
}
Unless B is inherited from A.
// Afterall I realized that even my comment lines have bugs
|
|
|
|
|
// creatfoufou.cpp: implementation of the creatfoufou class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "OpenGl.h"
#include "creatfoufou.h"
#include "foufou.h"
#include
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
creatfoufou::creatfoufou()
{
}
creatfoufou::~creatfoufou()
{
}
void creatfoufou::creatfou(int amount)
{
foufou *newfoufouPtr;
int randomX,randomY,randomZ;
int speed,steer;
for(int index=0;index {
newfoufouPtr = new foufou();
fou_caracter.push_back( newfoufouPtr );
//ici vien l'integration ou le dessin de foufou dans la scene
randomX = ( ( 1 + rand( ) % 900 ) - 450 );
randomY = ( ( 1 + rand( ) % 100 ) - 50 );
randomZ = ( ( 1 + rand( ) % 900 ) - 450 );
setposition(randomX,randomY,randomZ);
//speed =
//steer =
//lui attribue sa vitesse
//lui attribuer son emplacement
//lui attribuer sa direction
}
}
void creatfoufou::setposition(int newX, int newY, int newZ)
{
-->the mistak RePaint(randomX,randomY,randomZ);
}
and here when i declared
// foufou.cpp: implementation of the foufou class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "OpenGl.h"
#include "foufou.h"
#include
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
foufou::foufou()
{
}
foufou::~foufou()
{
}
//Propriétés réflectives de l'objet touché par la lumière
GLfloat Material_Ambiante[]={0.5,0.5, 0.5, 1 };
GLfloat Material_Difuse[]={0.5, 0.5, 0.5, 1};
GLfloat Material_Specular[]={0.5, 0.5, 0.5, 1};
//Propriété de la lumière
GLfloat Light_Ambiante[]={0.2, 0.2, 0.2, 0.1};
GLfloat Light_Difuse[]={0.5, 0.5, 0.5, 1.0 };
GLfloat Light_Specular[]={1.0, 1.0, 1.1, 1.0 };
GLfloat Light_Position[]={10, 12, 10, 1.0 };
GLfloat Light_Direction[]={0.0,-1.0, 0.0, 1.0};
void foufou::Initial()
{
//Définir les propriété de l'objet touché par la lumière ainsi que la lumière
glMaterialfv( GL_FRONT, GL_AMBIENT, Material_Ambiante);
glMaterialfv( GL_FRONT, GL_DIFFUSE, Material_Difuse);
glMaterialfv( GL_FRONT, GL_SPECULAR,Material_Specular);
glMaterialf( GL_FRONT, GL_SHININESS, 20);
glLightfv( GL_LIGHT0, GL_AMBIENT,Light_Ambiante );
glLightfv( GL_LIGHT0, GL_DIFFUSE, Light_Difuse );
glLightfv( GL_LIGHT0, GL_SPECULAR, Light_Specular);
glLightfv( GL_LIGHT0, GL_POSITION, Light_Position );
//Activation de l'éclairage
glEnable( GL_LIGHTING );
//Activation de la première lumière
glEnable( GL_LIGHT0 );
//Activation du test de profondeur
glEnable( GL_DEPTH_TEST );
};
void foufou::RePaint(int xpos,int ypos,int zpos)
{
//Vidage du contenu situé à l'écran
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
//glClearColor(0.3, 0.3, 0.3, 1.0);
//On réénitialise la matrice modélisation-visualisation
glMatrixMode (GL_PROJECTION);
glLoadIdentity ();
//On place la caméra dans la scène
gluPerspective (90, 1, 5, 50);
gluLookAt (2,2, -15, -4,0.0, 1, 0.0, 1.0, 0.0 );
//surface avec rotation de 45°
glPushMatrix();
//rotation de la surface
// glTranslated(0.0, 30.0, 15.0 );
// glRotated( 15, 0.0, 0.0, 0.0 );
////////
//Proprité de réfléction ambiante de la matière
glColorMaterial( GL_FRONT, GL_AMBIENT );
glColor4f(0.5, 0.5, 0.6, 1.0 );
//Proprité de réfléction diffuse de la matière}
glColorMaterial( GL_FRONT, GL_DIFFUSE );
glColor4f( 0.5, 0.2, 0.8, 1.0 );
//Proprité de réfléction speculaire de la matière}
glColorMaterial( GL_FRONT, GL_SPECULAR );
glColor4f( 0.9, 0.8, 1.0, 1.0 );
//Création de la surface 30 x 30}
//glutSolidCube(3);
glTranslated(-xpos, ypos, zpos );
glutSolidSphere(0.9,30,40);
glDisable( GL_LIGHTING );
glPopMatrix();
//glDisable(GL_TEXTURE_2D);
SwapBuffers(wglGetCurrentDC());
};
|
|
|
|
|
aguest wrote:
void creatfoufou::setposition(int newX, int newY, int newZ)
{
-->the mistak RePaint(randomX,randomY,randomZ);
}
aguest wrote:
void foufou::RePaint(int xpos,int ypos,int zpos)
This is exactly what I stated in my previous message. Even though you declared RePaint as a public function in foufou class you can't just use it in createfoufou. You need to call it this way:
class createfoufou
{
public:
createfoufou()
private:
foufou *newfoufouPtr;
};
createfoufou::createfoufou()
{
newfoufouPtr = new foufou;
};
void creatfoufou::setposition(int newX, int newY, int newZ)
{
newfoufouPtr->RePaint(randomX,randomY,randomZ);
}
// Afterall I realized that even my comment lines have bugs
|
|
|
|
|
when i must declare
<br />
void B::SomeBFunc(){ A aInst; aInst.AFunc();
in which class or file(.h or .cpp)
|
|
|
|
|
In createfoufou.cpp
// Afterall I realized that even my comment lines have bugs
|
|
|
|
|
i make all what u ask me ,and this mistake don't stille but other mistakes appears:
<br />
OpenGlView.obj : error LNK2005: "int PANIC_SPEED" (?PANIC_SPEED@@3HA) already defined in creatfoufou.obj<br />
OpenGlView.obj : error LNK2005: "int MINIMUM_SPEED" (?MINIMUM_SPEED@@3HA) already defined in creatfoufou.obj<br />
OpenGlView.obj : error LNK2005: "int STARTINGSPEED" (?STARTINGSPEED@@3HA) already defined in creatfoufou.obj<br />
OpenGlView.obj : error LNK2005: "class std::vector<class foufou *,class std::allocator<class foufou *> > fou_caracter" (?fou_caracter@@3V?$vector@PAVfoufou@@V?$allocator@PAVfoufou@@@std@@@std@@A) already defined in creatfoufou.obj<br />
OpenGlView.obj : error LNK2005: "int num_fou_caracter" (?num_fou_caracter@@3HA) already defined in creatfoufou.obj<br />
Debug/OpenGl.exe : fatal error LNK1169: one or more multiply defined symbols found<br />
Error executing link.exe.<br />
Creating browse info file...<br />
<br />
OpenGl.exe - 6 error(s), 2 warning(s)<br />
this
<br />
#if !defined(AFX_CREATFOUFOU_H__BE7E5BDB_1815_48E7_AAC4_B30A8F281BA4__INCLUDED_)<br />
#define AFX_CREATFOUFOU_H__BE7E5BDB_1815_48E7_AAC4_B30A8F281BA4__INCLUDED_<br />
<br />
<br />
<br />
#if _MSC_VER > 1000<br />
#pragma once<br />
#endif // _MSC_VER > 1000<br />
#include "gl/glut.h"<br />
#include "foufou.h"<br />
#include <vector> <br />
<br />
int STARTINGSPEED = 150;<br />
int MINIMUM_SPEED =80;<br />
int PANIC_SPEED =25;<br />
<br />
using namespace std;<br />
vector< foufou * > fou_caracter;<br />
int num_fou_caracter;<br />
<br />
class creatfoufou <br />
{<br />
<br />
<br />
public:<br />
GLfloat randomZ;<br />
GLfloat randomY;<br />
GLfloat randomX;<br />
void setposition(int newX,int newY,int newZ);<br />
void creatfou(int amount);<br />
<br />
creatfoufou();<br />
virtual ~creatfoufou();<br />
private:<br />
foufou *ptrfoufou;<br />
<br />
};<br />
<br />
#endif // !defined(AFX_CREATFOUFOU_H__BE7E5BDB_1815_48E7_AAC4_B30A8F281BA4__INCLUDED_)<br />
|
|
|
|
|
I am not sure but my best guess is that these variables:
int STARTINGSPEED = 150;
int MINIMUM_SPEED =80;
int PANIC_SPEED =25;
using namespace std;
vector< foufou * > fou_caracter;
int num_fou_caracter;
have been declared somewhere else. Maybe in creatfoufou.cpp or foufou.h.
// Afterall I realized that even my comment lines have bugs
|
|
|
|
|