|
complex (as most standard things) is inside namespace std.
|
|
|
|
|
Thanks, I really miss that line in the program.I could access this
type now in the class function.
void trest::tesin(complex<float> a)
{
complex<float> b;
b = b * b;
}
I am trying to use it in the class function declaration part. The complier scream again for error.
rest.h(11) : error C2871: 'std' : does not exist or is not a namespace
trest.h(16) : error C2061: syntax error : identifier 'complex'
trest.cpp(30) : error C2511: 'tesin' : overloaded member function 'void (class std::complex<float>)' not found in 'trest'
trest.h(13) : see declaration of 'trest'
|
|
|
|
|
Hey, got my problems solved! Just a few missing lines from the original codes. Thanks for all your help guys!
Cheers,
Danny
|
|
|
|
|
I use ACCESS file as my database,but when I add a record into it,it throw error as follow:
invalid character or specs (NULL).
what cause this error occured? and how to solve it?
(I use MFC ODBC )
the program code as follow:
sqltext.Format ("select * from example");
pRS->Open (AFX_DB_USE_DEFAULT_TYPE,sqltext,CRecordset::dynamic);
pRS->AddNew();
//开始读文件
long length=filedata.GetLength ();
HGLOBAL hData=GlobalAlloc(GHND,length);
pRS->m_filename=filename;
pRS->m_filelength=length;
pRS->m_filedata.m_dwDataLength=length;
pRS->m_filedata.m_hData=GlobalLock(hData);
filedata.ReadHuge (pRS->m_filedata.m_hData,length);
pRS->SetFieldDirty (&pRS->m_filedata);
pRS->SetFieldNull (&pRS->m_filedata,FALSE);
pRS->Update ();
pRS->Close ();
GlobalUnlock(hData);
GlobalFree(hData);
filedata.Close ();
Don't look at me in that way!
|
|
|
|
|
Are all fields of that TABLE binded with variables?
Did you assign all the variables valid values?
Does string type field(s) allow null string ( "" ) ?
...
Maxwell Chen
Lets make bugs better!
|
|
|
|
|
all fields has benn binded with variables.there are 3 field in the table
"filename",TEXT 255
"filedata" OLE
"filelength" LONG.
I debug the program,the variable is "diary.ini"(NOT NULL);
but it will throw the error yet!
I don't know why!
by the way!are you Chinese?
Don't look at me in that way!
|
|
|
|
|
If the exception really happened at the field (TEXT 255), I guess there should be some other problem , ... if it does! But I figure it might not the string problem though.
white jungle wrote:
by the way!are you Chinese?
It depends on how you think. You can think I am; you can think am not because I live in Taiwan, I use traditional Chinese language......
Maxwell Chen
Lets make bugs better!
|
|
|
|
|
I want to email the code to you,and hope you can help me?
ok?
I am Chinese!I live in Wuhan Hubei!
Don't look at me in that way!
|
|
|
|
|
OK.
Send it to my Yahoo mailbox.
Maxwell Chen
Lets make bugs better!
|
|
|
|
|
Try to catch a CDBException* e
like this
[code]
try
{
// your code
}
catch (CBDException* e)
{
AfxMessageBox (e->m_strError);
e->Delete ();
}
[/code]
Then tell us what the error is and maybe we can help you with that
Best regards,
Alexandru Savescu
|
|
|
|
|
the error code is:
Invalid character or spec (NULL)
(I use Chinese OS ,I translate it into english,hope you can understand )
Thank you for your help!
Don't look at me in that way!
|
|
|
|
|
I solved your problem and have sent the code modified by me back to you already. I also solved the problem while initializing the dialog, don't add the absolute path to your database location.
The filename crash problem is the recordset pointer crashed memory map of CString.
Maxwell Chen
Lets make bugs better!
|
|
|
|
|
I want to transform bmp image by disperse cosine transform ,because bmp image is two dimension ,so I want to use twice one dimension DCT , then I use two dimension Inverse disperse cosine transform to transform the data what I have tranformed by two dimension DCT ,I want to recover the bmp image by IDCT , but I don't know how to write two dimension Inverse disperse cosine transform ,
can you help me ? thank you
|
|
|
|
|
|
Hi,
I am having a problem with the Class View in MS VC++ 6.0 (SP 5). It does not display my classes/structures that were defined in a header file (.h). Classes locally defined in a file show up correctly.
I tried deleting the NCB file but it didn't solve my problem.
Is there a solution to this problem?
Thanks,
Francisco
|
|
|
|
|
try deleting the .clw file and rebuilding the clw file by activating classwizard.
|
|
|
|
|
My project is not using MFC, so I don't have a CLW file.
Francisco
|
|
|
|
|
I found the problem: the header files were not directly added to the project, so Class View was not displaying them. Adding them to the project fixed the problem.
Francisco
|
|
|
|
|
IBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/Accounts.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
This is my HEADER file
#ifndef ACCOUNTS_H
#define ACCOUNTS_H
class Accounts
{ private:
int num;
int type;
float balance;
public:
Accounts();
int getnum();
void setnum(int n);
int gettype();
void settype(int t);
float getbalance();
void setbalance(float b);
};
#endif
This is my CPP file:
#include "Accounts.h"
#include <string.h>
#include <iostream.h>
int Accounts::getnum()
{ return num; }
void Accounts::setnum(int n)
{ num=n; }
int Accounts::gettype()
{ return type; }
void Accounts::settype(int t)
{type=t; }
float Accounts::getbalance()
{ return balance; }
void Accounts::setbalance(float b)
{ balance =b; }
I appreciate any suggestion.
Thank you
|
|
|
|
|
1. You have included iostream.h - don't. Include iostream and use the things you need from namespace std.
2. Where is your main() function ?
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
And you don't spend much time with the opposite sex working day and night, unless the pizza delivery person happens to be young, cute, single and female. I can assure you, I've consumed more than a programmer's allotment of pizza, and these conditions have never aligned. - Christopher Duncan - 18/04/2002
|
|
|
|
|
I've got a little problem that I just can't get my head around. I'm needing to write a program that can extract files from ace archived files. Basically it would be an installer application for a couple of things I've made up & compressed to make them smaller.
Everything else in the program is working fine, its just a simple MFC dialog program with options for picking the install dir and not a lot else I know that I need to use the unace.dll file from www.winace.com but I just don't know how to use it
Could anyone that might have used it before or knows a bit about dlls be able to point me in the right direction for where I need to include the dll file, how to include it and how to call the functions to get the aces extracted?
Thanks for helping
|
|
|
|
|
Hi!
Download whole package from winace.com (http://www.emerge.de/ftp/dev/unacedll.exe).
It contains not just only dll, but also documentation and sample sources which are rather helpful.
Mukkie
|
|
|
|
|
I have this dll with a routine in it that I what to call.
Lets call it comp1.
So ... I create a project and add a C++ file to it that looks like this
I change my prject setting so that comp1.lib is in that setting
window.
#include <stdio.h>
#include "comp1.h"
void main( int argc, char * argv[] ) {
char array[19];
comp1( "blah", "blah1", "blah3", array );
}
I compile ok but when I link I get this error
LNK2001: unresolved exteranl symbol "int __cdecl comp1( char *, char*, char*, char *const)" (?comp1@@YAHOOSOMETHING@Z)
What am i doing wrong?
|
|
|
|
|
Try using:
#pragma comment(lib, "comp1.lib")
See if that works.
-Jack
To an optimist the glass is half full.
To a pessimist the glass is half empty.
To a programmer the glass is twice as big as it needs to be.
|
|
|
|
|
#pragma works
It tells me it cannot open comp1.lib
I have copied comp1.lib to every directory on my hard drive!
How can I get pragma to tell why it cannot open comp1.lib?
Thanks!
|
|
|
|