|
I would have needed to run some tests, but it may have to do with the fact that the source contains more than one character. I would change the second parameter from a character type to a string type and see what happens.
I dought that will work, because it works in your application. That said, it is where I would start.
How badly does the program crash?
Can you give an error number?
It has been a while since I created a DLL, but I looked up the specs and did not see anything wrong.
I do not see a return type specified for "freadCharacter", but the compiler would scream if that was missing in the actual code.
Eikthrynir wrote: Is it a real problem that I call a function defined in a dll which takes a reference to istream as a parameter?
I can think of no reason why that would cause a problem.
INTP
Every thing is relative...
|
|
|
|
|
I run my program under Windows XP Professional. When it crashes, Windows doesn't show me any run-time error number. It just tells me something like this:
"Test.exe has encountered a problem and needs to close.
We are sorry for the inconvenience." It's the standard Windows message which appears at every program crash. I have tried even to change the second parameter of freadCharacter into an int . I get the same run-time error. I have tested in freadCharacter whether inputStream is open and it is. I thought that maybe that is my problem, but it's not.
Thanks!
|
|
|
|
|
I have no idea what the problem is, but I can give you the name of the best book I know of.
Programming Applicationtions for Microsoft Windows
By Jeffrey Richter.
I consider Jeffrey Richter a master Windows Guru, he has even taught people at Microsoft on the subject. I do not know if he has written anything directly related to C++ (where I think your problem may lay), but search for his name.
Sorry that I did not have time to investigate this furthur myself.
John R. Shaw
INTP
Every thing is relative...
|
|
|
|
|
I really appreciate and thank you for the time spent in helping me solve this problem. I will search for Mr. Jeffrey Richter's book. Thanks again!
|
|
|
|
|
COleDateTime t = COleDateTime::GetCurrentTime();
CString str = t.Format(_T("%A, %B %d, %Y"));
m_edit.SetWindowText(str);
Hi, when i first tried the above code on a new empty project, it worked without any problems.(after including the ATLComTime.h)
But i finally modify and use it in my intended solution and i have 4 errors and 4 warnings:
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\ObjIdl.h(246) : warning C4935: assembly access specifier modified from 'public'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\ObjIdl.h(258) : warning C4935: assembly access specifier modified from 'public'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\ObjIdl.h(7408) : error C2872: 'IDataObject' : ambiguous symbol
could be 'C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\ObjIdl.h(246) : System::Windows::Forms::IDataObject IDataObject'
or 'stdafx.cpp(0) : System::Windows::Forms::IDataObject'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\ObjIdl.h(7422) : fatal error C1903: unable to recover from previous error(s); stopping compilation
Form1.cpp
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\ObjIdl.h(246) : warning C4935: assembly access specifier modified from 'public'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\ObjIdl.h(258) : warning C4935: assembly access specifier modified from 'public'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\ObjIdl.h(7408) : error C2872: 'IDataObject' : ambiguous symbol
could be 'C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\ObjIdl.h(246) : System::Windows::Forms::IDataObject IDataObject'
or 'stdafx.cpp(0) : System::Windows::Forms::IDataObject'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\ObjIdl.h(7422) : fatal error C1903: unable to recover from previous error(s); stopping compilation
Generating Code...
Can you figure out what I might nid to do? Tks
|
|
|
|
|
the is my function ....
there is some bug ...
Could you do me a favor !!! Thanks .....
{
HINSTANCE hClcltr=LoadLibrary("sqlite3.dll");
LPFNMLTPLY sqlite3_open;
sqlite3_open = (LPFNMLTPLY)GetProcAddress(hClcltr,"sqlite3_open");
sqlite3 *m_db;
m_db = NULL ;
int m_Rslt=sqlite3_open(_T("testdb"),&m_db);
FreeLibrary( hClcltr );
}
Can't Complier ==> Error Message!!!
'int (int,int)' : cannot convert parameter 2 from 'struct sqlite3 ** ' to 'int'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
error C2664: 'int (int,int)' : cannot convert parameter 1 from 'char [7]' to 'int'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
Thanks
|
|
|
|
|
The sqlite function is defined as:
<br />
int sqlite3_open(<br />
const char *filename, <br />
sqlite3 **ppDb <br />
);<br />
Based on the error, it looks like you've defined the function pointer as:
<br />
typedef int (*LPFNMLTPLY)(int,int);<br />
when it should be
<br />
typedef int (*LPFNMLTPLY)(const char*, sqlite3**);<br />
"My dog worries about the economy. Alpo is up to 99 cents a can. That's almost seven dollars in dog money" - Wacky humour found in a business magazine
|
|
|
|
|
Thanks you ....
You help to solve the problem ......
you are right !
I Find that Line I write ==> typedef int (*LPFNMLTPLY)(int,int);
when I modify ===> typedef int (*LPFNMLTPLY)(const char*, sqlite3**);
The complier is correct !!!
Thanks very much
Thanks
|
|
|
|
|
Okay guys, Can someone point me to a tutorial, beginners area for Embedded
MS CE programming with C++? I've got an Axiomtek GOT-2570S that was just
dropped in my lap. I've been given 6 weeks to learn it, develop an app for
it and have it ready to ship. So, I need a crash course in MS CE programming.
Please help.
Greg
|
|
|
|
|
1. Try the Mobile Development forum.
2. I'm trying to resist a comment about your ID, I really am
Elaine
The tigress is here
|
|
|
|
|
Kind of an oxymoron isn't it???(lol)
Thanks for the direction.
|
|
|
|
|
hi all ,
does anybody know how to convert const char * to LPCTSTR and vice versa ?
thank you.
-- modified at 11:35 Thursday 16th March, 2006
|
|
|
|
|
big_denny_200 wrote: anybody know how to convert const char * to LPCTSTR and vice versa
I thought LPCTSTR is for (Long Pointer To Constant String) which is same as const char *
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
i think what you wrote is LPCSTR not LPCTSTR
I have passed const char* object to a method which required LPCTSTR and got an error.
don't know exactly I am pretty new to C++
|
|
|
|
|
because you might have UNICODE set on your project. haven't you ?
|
|
|
|
|
yes, but i need to do the convertion anyway.
because i use some function that returns const char* and then need to pass it to function which requires LPCTSTR .
can you help ?
|
|
|
|
|
you didn't answer to my question.
do you have unicode enabled in your project or not ?
see W2A() and A2W() macros for such conversion anyway...
|
|
|
|
|
actually, T is for TCHAR, so it is a typedef to const TCHAR*
|
|
|
|
|
The "T" doesn't mean Unicode. A TCHAR can be either char or wchar_t depending on if your building a Unicode build or not. It depends on the UNICODE , _UNICODE and _MBCS preprocessor definitions.
Steve
|
|
|
|
|
it doesn't mean unicode,, but it's still there for it
|
|
|
|
|
|
OK, I have read just about every printing example I can find and I still cannot find a way to do this.
In my app, non-MFC, I have a listview containing quite a bit of data. I need to be able to print this data as a table. Printing lines of text and bitmaps is no problem, but when it comes to trying to structure this data it's getting a little confusing.
The table itself will never change, only the text and cell data. So It's no problem to create a template stored in the resources to which I can simply add cell values. But what sort of file should I create that can easily be populated and printed?
Please somebody kick me towards the right link.
|
|
|
|
|
Check out the Printing section on the left menu.
http://www.codeproject.com/printing/printlib.asp[^]
This article has a sample of defining printing tables.
He was a snowflake, like other "unique" snowflakes, falling down, getting stepped on, and pushed aside to disappear.
|
|
|
|
|
Hi all,
I have already a standad Visual C++ . NET, version from year 2003.
And, with this Visual C++ . NET [ version 2003], is it necessary to download VC++ Express Edition 2005?
Also, is it fully compatible with SDK plateforme + DirectX 9 installad from February 2006?
And, with this Visual C++ . NET [ version 2003], y is it necessary to download VC++ Express Edition 2005?
Thanks a lot
Regards!
|
|
|
|
|
Visual C++ .NET 2003 and Visual C++ 2005 are two (almost) completely different languages. the 2005 version cleans the syntax up A LOT and is called C++/CLI. The express edition should be compatible with any recent SDK's. I recommend downloading 2005 since it's free, and it makes it a lot easier to target the .NET platform
Thanks,
John
|
|
|
|