|
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!
|
|
|
|
|
oops correction ... compl.lib was not in te right directory.
I have copied it to the right place now and pragma lib doesn't
say anything now. and I am now doing a the
extern "C" {
...
}
... bit and now I get LNK1106: invalid file or disk full: cannot seek 0xa3298473298
AAARRRRRRGGGGGHHHHH!!!!!
help!
|
|
|
|
|
Now there is some errors in my code, but it's late now and I have to go to bed!
But can you tell me how to do this:
// dir_bcast_addr is a u_long and is wron type to fit..
bcast.sin_addr.s_addr = inet_addr(dir_bcast_addr);
int main()
{
WSAData wsaData;
int nCode;
if ((nCode = WSAStartup(MAKEWORD(2, 0), &wsaData)) != 0)
{
cout << "Ett fel inträffades när Winsock skulle startas, felkod " << nCode << "." << endl;
return 1;
}
SOCKET s;
BOOL bBroadcast;
char *sMsg = "This is a test";
SOCKADDR_IN bcast;
s = WSASocket(AF_INET, SOCK_DGRAM, 0, NULL, 0, WSA_FLAG_OVERLAPPED);
bBroadcast = TRUE;
setsockopt(s, SOL_SOCKET, SO_BROADCAST, (char *)&bBroadcast, sizeof(BOOL));
u_long host_addr = inet_addr("192.169.244.152");
u_long net_mask = inet_addr("255.255.255.128");
u_long net_addr = host_addr & net_mask;
u_long dir_bcast_addr = net_addr | (~net_mask);
bcast.sin_family = AF_INET;
bcast.sin_addr.s_addr = inet_addr(dir_bcast_addr);
bcast.sin_port = htons(5150);
sendto(s, sMsg, strlen(sMsg), 0, (SOCKADDR *)&bcast, sizeof(bcast));
while(TRUE)
{
char* buffer = new char[1024];
SOCKADDR_IN sender;
int sos = sizeof(sender);
int ret = recvfrom(s, buffer, sizeof(buffer), MSG_OOB, (SOCKADDR*)&sender, &sos);
if (ret == SOCKET_ERROR)
{
printf("recvfrom() failed; %d\n", WSAGetLastError());
break;
}
else if (ret == 0)
{
break;
}
else
{
buffer[ret] = '\0';
printf("[%s] sent me: '%s'\n", inet_ntoa(sender.sin_addr), buffer);
}
delete [] buffer;
}
closesocket(s);
WSACleanup();
return 0;
}
The error code is 10045 and it means that the function call or something is nott allowed!!???
Now I have to go and sleep!
See ya to morrow!
Rickard Andersson@Suza Computing
ICQ#: 50302279 (Add me!)
E-mail: nikado@pc.nu
I'm from the winter country SWEDEN!
|
|
|
|
|
I have been working on double buffering my CListView for the past few days... After this bit of code below, my list is now flicker free. The only problem I am having is that my Header wasn't being drawn.. When I add my code to draw the Header my items are shifted down for example.. when I add a item to row 1 its drawn in row 2 (row 1 appears empty) so if you click the mouse on the empty row 1 it highlights row 2, and so on.. if I exclude the code for the Header all the items are drawn correctly.
Any ideas on what I am doing wrong?
void CMyListView::OnPaint()
{
CRect rc;
CRect rcWnd;
CRect rcH;
CPaintDC dc(this);
CDC MemoryDC;
CBitmap Bitmap;
CBrush Brush;
GetParent()->GetClientRect(&rc);
if (rc.Size() == CSize(0,0))
return;
GetParent()->GetWindowRect(&rcWnd);
CHeaderCtrl* pHC = (CHeaderCtrl*)(GetListCtrl().GetDlgItem(0));
if(pHC != NULL)
{
pHC->GetItemRect(0,&rcH);
rc.top += rcH.bottom;
}
int rcWndW = rcWnd.Width(), rcWndH = rcWnd.Height();
TRACE("%d %d", rcWndW, rcWndH);
MemoryDC.CreateCompatibleDC(&dc);
Bitmap.CreateCompatibleBitmap(&dc, rcWndW, rcWndH);
CBitmap *pOldBitmap = MemoryDC.SelectObject(&Bitmap);
Brush.CreateSolidBrush(dc.GetBkColor());
MemoryDC.FillRect(&CRect(0,0, rcWndW,rcWndH), &Brush);
Print(&MemoryDC, PRF_CLIENT);
Print(&MemoryDC,PRF_OWNED);
CRect rcDraw = rc - rc.TopLeft();
dc.BitBlt(rc.left,rc.top, rc.Width(),rc.Height(), &MemoryDC, rcDraw.left,rcDraw.top, SRCCOPY);
MemoryDC.SelectObject(pOldBitmap);
}
|
|
|
|
|
RobJones wrote:
if I exclude the code for the Header all the items are drawn correctly.
But the header isn't? I wouldn't think you'd have to allow for it, really.
In any case, this line:
CRect rcDraw = rc - rc.TopLeft();
appears to be doubling the offset for rcDraw , probably not what you really want (all drawing done by Print() assumes client coodinates AFAIK, so the top of the client area is drawn at (0,0)).
--------
This is what we've waited for
This is it boys, this is War! --Shog9 --
|
|
|
|
|
I remarked the line you suggested and set the following.. its still doing the same thing .
dc.BitBlt(rc.left,rc.top, rc.Width(),rc.Height(), &MemoryDC, 0,0, SRCCOPY);
Could it be that i am some how not including the header in both the dc's?
Im at home so its showing the post as Anonymous.
|
|
|
|
|
Anonymous wrote:
Could it be that i am some how not including the header in both the dc's?
Possibly. But, rc.top is not going to be 0 either; it will be the height of the header. The line should read:
dc.BitBlt(rc.left,rc.top, rc.Width(),rc.Height(), &MemoryDC, rc.left,rc.top, SRCCOPY);
I'm curious as i've never tried doing this: is the header actually drawn into the buffer? Or does it get painted separately.
Good Luck
--------
This is what we've waited for
This is it boys, this is War! --Shog9 --
|
|
|
|
|