|
|
are you using _declspec(dllexport) macro or the DEF file to export your classes? Could u pls send me a sample line showing, how u try to export them?
Regards,
Buddhike de Silva
|
|
|
|
|
In VC6.0,when I debug my program Test that depends on a DLL,a message box always pops up with "Unhandled exception in Test.exe[MSCTF.DLL]:0XC0000005:Access Violation".But when executing it,the undesired thing doesn't emerge.Why???
Please help me!!!
Rap off for you,for me,for our human.
|
|
|
|
|
hi,
i just get frustrated about the problem,
i m trying to connect with the Server using Winsock
and then successfully able to send the packet usinf send() function but will not be able to receive the packet from server using recv() function.
just look at my code snippet.......
WSADATA wsaData;
long Error;
int iResult = WSAStartup(MAKEWORD(2,2), &wsaData);
if (iResult != NO_ERROR)
printf("Error at WSAStartup()\n");
// Create a SOCKET for connecting to server
SOCKET ConnectSocket;
ConnectSocket = socket(AF_INET, SOCK_STREAM, 0);
if (ConnectSocket == INVALID_SOCKET)
{
printf("Error at socket(): %ld\n", WSAGetLastError());
WSACleanup();
return;
}
// The sockaddr_in structure specifies the address family,
// IP address, and port of the server to be connected to.
char* localIP;
hostent* localHost;
int portNumber = 443;
localHost = gethostbyname("hostname");
localIP = inet_ntoa (*(struct in_addr *)*localHost->h_addr_list);
sockaddr_in clientService;
clientService.sin_family = AF_INET;
clientService.sin_addr.s_addr = inet_addr(localIP);
clientService.sin_port = htons(portNumber);
// Connect to server.
if ( connect(ConnectSocket,(SOCKADDR*)&clientService,sizeof(clientService)) == SOCKET_ERROR)
{
printf( "Failed to connect.\n" );
Error = WSAGetLastError();
printf("\n %ld \n",Error);
WSACleanup();
return;
}
// strcpy(sendbuf,"a400\ws.asp");
bytesSent = send(ConnectSocket,sendbuf,strlen(sendbuf),0);
printf("Bytes Sent: %ld\n", bytesSent );
bytesRecv = recv(ConnectSocket,recvbuf,bytesSent,0);
if (bytesRecv <= 0)
printf("\n Error : %d",WSAGetLastError());
WSACleanup();
|
|
|
|
|
Hi,
i think so u need to use the particular port for that pop3 port is 110 like that. try it.
Have A Nice Day
Murali.M
|
|
|
|
|
I have a program with 3 class (actually 4, but the last one will work if i can get the other 3 to work), let's call them A, B, and C. A uses both B and C as private data members, and B and C each use A as a private data member. Apparently i can't simply use include directives, since circular inclusions like that are prohibited. so i tried using foreward declarations, but that did nothing. then i tried using include directives for A, but foreward declarations for B and C. If i do that, then A works, but B and C each have a lot of errors. they don't register A as a declared class. any idea how i can fix this?
|
|
|
|
|
How do forward declarations 'not work' for you ?
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Anonymous wrote:
A uses both B and C as private data members, and B and C each use A as a private data member.
You can't do this. This basically creates a class that has an infinite size since A includes B which includes A which includes B etc. The way to do this is to include a pointer to A inside B and C, and then a forward declaration of A in the include files for B and C will work nicely.
Hope this helps,
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
probably should have said this earlier, but that's what it is. the code itself is fine; the professor gave it to us to organize into separate files. in one file it compiles fine. it's just when i try to put them in separate files when the problems arise.
as for what i meant by 'not work', i should have said 'has errors'. pardon the confusion.
|
|
|
|
|
You are probably using forward declarations
but not using member pointers or references to those classes
class A;<br />
<br />
class B( {<br />
A* m_a;<br />
};<br />
<br />
class A {<br />
friend class B;<br />
...<br />
};
|
|
|
|
|
Hi, i have a SDI App(generated with app wizard) with a file menu bar that envokes another dialog class..
my prob is trying to get a pointer from the dialog class that is envoked from the menu bar back to the original main dialog class created by the app wizard.
that way i can access the main dialog windows data
Thanks
|
|
|
|
|
try this:
CMyMainDlg::ShowOtherDialog()
{
COtherDlg myOtherDlg;
myOtherDlg.DoModal();
my_var = myOtherDlg.some_variable;
}
type of thing
"there is no spoon" biz stuff about me
|
|
|
|
|
If I understand right, you should simply declare the dialog class as a member of CMainFrame . In menu item handler you call only DoModal() .
|
|
|
|
|
Can sombody help me?
I`ve read all postings but I can`t find something it helps me!
Why different the result of PdhGetFormattedCounterValue function(ex - "\\Process(process_name)\\% Processor Time") and Windows Task Manager?
O/S : Windows 2000 Server.
CPU : Dual-CPU
single CPU, Windows 2000 professional is no problem.
help me!!!
|
|
|
|
|
i know to use setupcomm() to set the size of i/o com buffers.
but how can i get its default size?
Thank u very much!
Hello World!
|
|
|
|
|
Hi all,
Firstly, how do I create a group box programmatically?
Secondly, I want the following to work:
m_MyGroupBox is my group box (CStatic). Surprise...
m_MyGroupBox->ShowWindow(SW_HIDE).
How can I make the controls "inside" the group box to also disappear?
By simply saying that m_MyGroupBox is the parent when creating the inner ctrls?
Thx,
/Tommy
|
|
|
|
|
You'll have to manually hide each of the controls. Setting the parent to the group box will break MFC's handling of dialog box controls, so I don't recommend doing it.
Hope this helps,
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Hi, how can i force my CEdit control to react to Ctrl +v and Ctrl+c. It doesnt do it automaticaly.
I tried the following but it doesnt work out :
dirive OnKeyDown in my class CEditEx
if ((::GetKeyState (VK_CONTROL)<0)&&(nChar == 0x63))
{
// do something
}
doesnt work with GetAsyncKeyState too.
Any sugestion why? Or there is other method to do this stuff?
Thanks
|
|
|
|
|
Hello
i have been asked to look at a dll "issue"
and i cant see why its acting up.
However, when the dll builds the linker throws a headcase and spews out a bunch of errors
<br />
<br />
ClientState.obj : error LNK2005: "char const * * RPD_APP_FILE_EXT" (?RPD_APP_FILE_EXT@@3PAPBDA) already defined in ClientControl.obj<br />
DisplayControl.obj : error LNK2005: "char const * * RPD_APP_FILE_EXT" (?RPD_APP_FILE_EXT@@3PAPBDA) already defined in ClientControl.obj<br />
EquipmentID.obj : error LNK2005: "char const * * RPD_APP_FILE_EXT" (?RPD_APP_FILE_EXT@@3PAPBDA) already defined in ClientControl.obj<br />
FaultData.obj : error LNK2005: "char const * * RPD_APP_FILE_EXT" (?RPD_APP_FILE_EXT@@3PAPBDA) already defined in ClientControl.obj<br />
MSCIntraInterface.obj : error LNK2005: "char const * * RPD_APP_FILE_EXT" (?RPD_APP_FILE_EXT@@3PAPBDA) already defined in ClientControl.obj<br />
MsgQueue.obj : error LNK2005: "char const * * RPD_APP_FILE_EXT" (?RPD_APP_FILE_EXT@@3PAPBDA) already defined in ClientControl.obj<br />
TcpListener.obj : error LNK2005: "char const * * RPD_APP_FILE_EXT" (?RPD_APP_FILE_EXT@@3PAPBDA) already defined in ClientControl.obj<br />
Sort of thing
The RPD_APP_EXT is defined in "globaldefines.h" which uses
<br />
#ifndef GlobalDefines_h<br />
#define GlobalDefines_h<br />
<br />
const char * RPD_APP_FILE_EXT[] = {".RPD", ".RVR", ".UDO", ".RDO", ".ZRP"};<br />
<br />
etc etc<br />
<br />
#endif<br />
<br />
And as well as that the header files for every class all correctly use
#ifndef < sometag >
#define < some tag >
.
(.class definitions etc)
#endif
also,The compiler settings are set with the multithreaded /md option
I was wondering if anyone had any suggestions as to what one might do to fix this issue?
regards
Bryce
---
Publitor, making Pubmed easy.
http://www.sohocode.com/publitor
|
|
|
|
|
Maybe char* const RPD_APP_FILE_EXT[] = {".RPD", ".RVR", ".UDO", ".RDO", ".ZRP"};
Hello World!
|
|
|
|
|
|
Try this...in globaldefines.h, say
#ifndef GlobalDefines_h
#define GlobalDefines_h
...other code...
extern const char* RPD_APP_FILE_EXT[];
...other code...
#endif
And then in some other .cpp file (perhaps globaldefines.cpp), do the actual definition of RPD_APP_FILE_EXT, i.e. in the cpp file:
#include "globaldefines.h"
const char* RPD_APP_FILE_EXT[] = {".RPD", ".RVR", ".UDO", ".RDO", ".ZRP"};
...other code...
Even if you have include-guards on your headers, if they're included in multiple places and have variable definitions (not just declarations), then you'll usually get those link errors.
HTH
|
|
|
|
|
maybe because you can not initialize variables in header files?
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
all fixed now, turns out one of the developers had been messing with the project settings
cheers all
bryce
---
Publitor, making Pubmed easy.
http://www.sohocode.com/publitor
|
|
|
|
|
I'm having all kinds of fun trying to iron out this problem, and im SURE there's an easy solution out there...
I need to use COM interop between unmanaged C++ and VB .NET to have my C++ client catch and respond to events raised in VB .NET. More specifically, I've got a VB .NET custom user ActiveX control with a valid COM interface that I've imported and used in my C++ client. I can make function calls from the COM client to the .NET server, but I cannot seem to handle events from the control.
I'm certainly no expert on COM interop, but I've browsed around and read bits of literature here and there on how to do this to no avail. The control doesn't seem to have any connection points to which I can connect to (which might be the problem), but trying to use ATL SINK_ENTRY with IDispEventImpl hasn't worked, nor has an MFC DECLARE_EVENTSINK_MAP with ON_EVENTs. I'm at a total loss and any help would be greatly appreciated.
P.S. if none of this works, would it be feasible to pass VB a C++ function pointer via its COM interface and then have VB "call" the C++ function using this pointer? They're in the same address space so it should work, but can VB call a function given only an address as a long?
|
|
|
|