|
I had designed a Dialog of Protocol Simulator. Inside the Dialog it have a IP address box to key in the the destination IP address, a edit box to tape your message, some button that when you click it will automatic send a message to the destination, and lastly a send button. I just don't know how to do the program that when I key in the IP address and click the button and it will send the message. I want to test the program using the 127.0.0.1 IP address. Can help me just give some guide and example.
|
|
|
|
|
I have VC2005,which means I have only one lot of headers for libraries like iostream, iostream.h is gone, not present, not part of the equation. I'm building a library for reading DICOM files which builds fine, but cannot link into my main project, I get these errors:
msvcprt.lib(MSVCP80.dll) : error LNK2005: "public: void __thiscall std::basic_ostringstream<char,struct std::char_traits<char="">,class std::allocator<char> >::`vbase destructor'(void)" (??_D?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ) already defined in dcmdata.lib(dcitem.obj)
msvcprt.lib(MSVCP80.dll) : error LNK2005: "public: class std::basic_ostream<char,struct std::char_traits<char=""> > & __thiscall std::basic_ostream<char,struct std::char_traits<char=""> >::operator<<(int)" (??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@H@Z) already defined in dcmimage.lib(diyp2img.obj)
msvcprt.lib(MSVCP80.dll) : error LNK2005: "public: class std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> > __thiscall std::basic_ostringstream<char,struct std::char_traits<char="">,class std::allocator<char> >::str(void)const " (?str@?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ) already defined in dcmdata.lib(dcitem.obj)
msvcprt.lib(MSVCP80.dll) : error LNK2005: "public: class std::basic_ostream<char,struct std::char_traits<char=""> > & __thiscall std::basic_ostream<char,struct std::char_traits<char=""> >::operator<<(double)" (??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@N@Z) already defined in dcmimgle.lib(dimomod.obj)
Only a lot more of them. I'm virtually at the point of being willing to offer my firstborn in return for a solution, does anyone have any ideas ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I am not exactly sure about these linker errors, but I have some similar problem with my project. After much scraching my head and reading forums I found that I was not building my library and executable using same runtime libraries. may be this is problem in your case also.
-Saurabh
|
|
|
|
|
The trouble is, there IS only one set of libraries in VC2005, the old ones have been removed.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Sorry I think I was not clear enough.
I also had this problem in visual studio 2005 beta 2 and there are two type of runtime libraries - multithreaded(/MT) and multithreaded dll(/MD). So in my case I was using /MT to build the library and /MD to build the exe and hence the problem.
Hope this helps.
- Saurabh
|
|
|
|
|
Ah.... OK. I am using MD in every case. Thanks tho.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Don't want to appear dense, but are you sure about this? The projects that come with those libs specify /MT for the release build and /MTd for the debug build. Did you change it to /MD?
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
I am positive - I changed it to /MD to match the MFC app. I've had to put several #undef's into my project to get it to compile as /MT, which is what I'm trying now, as I can't find where _AFXDLL is being #defined.
I'm just building that now, having changed the libraries back and having re built them.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Christian Graus wrote:
I've had to put several #undef's into my project to get it to compile as /MT, which is what I'm trying now, as I can't find where _AFXDLL is being #defined.
_AFXDLL is defined when you specify that you want to "Use MFC in a Shared DLL". That setting is under Configuration Properties / General / Use of MFC.
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
|
Thanks - I will read that later, it seems to be talking about my exact problem. YEah, I've read the forum for dcmtk over and over, and tried everything they suggest.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Christian Graus wrote:
Thanks - I will read that later, it seems to be talking about my exact problem. YEah, I've read the forum for dcmtk over and over, and tried everything they suggest.
No problem, the MSDN link pretty much discusses the include order and how to deal with.
Good luck...
-------------------------------
DEBUGGING : Removing the needles from the haystack.
|
|
|
|
|
Actually, while these are broadly the errors I am getting, they are not for new, delete or DllMain, so I think this isn't going to solve my problem. It could be a step in the right direction tho....
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Christian Graus wrote:
Actually, while these are broadly the errors I am getting, they are not for new, delete or DllMain, so I think this isn't going to solve my problem. It could be a step in the right direction tho....
Problems with new and delete? How’s that possible?
This maybe a rather silly suggestion, but have you created a generic app to test the DLL with? I see from previous posts that the DLL was not written in VS2005; perhaps more work is needed on the DLL to get it compliant with the language changes.
-------------------------------
DEBUGGING : Removing the needles from the haystack.
|
|
|
|
|
Hi all,
I am learning mysql database on c++.
I have a problem for function mysql_list_dbs():
how to get all database name in mysql server?
code is:
---------------------------------------------
MYSQL_RES*pRes=mysql_list_dbs(pMySQL,0);
if(pRes==0) return 1;
//don't know how to enum or fetch all dbs here.
---------------------------------------------
I can not find any sample of using the function.
do you know any links or code which are next step for the function?
thanks
includeh10
|
|
|
|
|
I need the MainFrame of my MDI app to be split (with CSplitterWnd), and subsequent CViews to be created in one of the CSplitterWnds. Is this possible?
Basically, I'm trying to get the MS Outlook look (the sidebar) in an MDI app.
Thanks
|
|
|
|
|
yes
i think the wizard for 6 and 7 both have the option to start yourp roject like that too
otherwise you create the splitters in CMainFrame::OnCreateClient
there is some example code how to do it in the msdn info on CSplitterWnd also
|
|
|
|
|
Hi!
I have the same problem. The MSDN did not really help.
Similar to splitting child-windows (in CChildFrame),
I tried to split CMainFrame. But what have I to insert
into the right pane - so that there are the child-windows.
CMainFrame can not work...
Alex
|
|
|
|
|
Hi all,
I'm trying to use sedtech.com's quick pdf library in Visual C 6 and it appears that they are no longer bothering to support their product so I thought I'd try here.
My application blows up when calling:
iSEDSetHTMLNormalFont( "Default", 0 );
to set the font type. I have the older version (4.??) of the
library.
Anyone have any IDEAS???
Thanks!!
Dave
|
|
|
|
|
hello
I have a question
In order to make smaller exes I use some linker options
that I got form somewhere I forgot from where
I understand pretty much what they do exept one :
#pragma comment(linker,"/base:0x13140000")
Anyway that is besides the point
I put these options:
#pragma optimize("gsy",on)
#pragma comment(linker,"/RELEASE")
#pragma comment(linker,"/ENTRY:main")
#pragma comment(linker,"/MERGE:.rdata=.data")
#pragma comment(linker,"/MERGE:.text=.data")
#pragma comment(linker,"/MERGE:.reloc=.data")
#pragma comment(linker,"/SECTION:.text,EWR /IGNORE:4078")
#pragma comment(linker,"/FILEALIGN:0x200")
#pragma comment(linker,"/base:0x13140000")
#pragma comment(linker,"/stub:stub.exe")
in a vc 7 win32 empty project
and when i put this:
void main()
{
char * ce_scrie=new char[100];
}
the project is buildable but then it gives out a error of the debug don't send kind(you know) and when I debug it I get a wierd error I have yet to see
Unhandled exception at 0x77f5171c in versiune_de_ie.exe: 0xC0000005: Access violation reading location 0x00000010.
the same stuff with vc 6 gets me this:
C:\Program Files\Microsoft Visual Studio\MyProjects\SmallVcExe\SmallVcExe.c(31) : error C2065: 'new' : undeclared identifier
C:\Program Files\Microsoft Visual Studio\MyProjects\SmallVcExe\SmallVcExe.c(31) : warning C4047: 'initializing' : 'char *' differs in levels of indirection from 'int '
C:\Program Files\Microsoft Visual Studio\MyProjects\SmallVcExe\SmallVcExe.c(31) : error C2143: syntax error : missing ';' before 'type'
C:\Program Files\Microsoft Visual Studio\MyProjects\SmallVcExe\SmallVcExe.c(31) : error C2143: syntax error : missing ';' before '['
C:\Program Files\Microsoft Visual Studio\MyProjects\SmallVcExe\SmallVcExe.c(31) : warning C4091: ' ' : ignored on left of 'char ' when no variable is declared
why is this?
|
|
|
|
|
I have a question:
supposing I call the
LookupAccountSid(NULL, ptiUser->User.Sid, szUser, pcchUser,szDomain, pcchDomain, &snu))
and I get the sid how can I print this sid?
|
|
|
|
|
In LookupAccountSid, the SID is an input parameter and what you get is user and domain names as character strings...
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
yes you are right but anyway I have the sid I just want to print it how do I do that ?
|
|
|
|
|
|
LPSTR * StringSid;
ConvertSidToStringSid(ptiUser->User.Sid,StringSid);
this gets me the run-time error " the variable StringSid is being used withouth having been initialized
so I try to initialize it:
LPSTR toader=new char[1024];strcpy(toader," ");
LPSTR * StringSid=&toader;
but this gets me a error also about access memory violation
what is the good way of doing this?
|
|
|
|