|
Axter wrote: Trailing underscore, meaning put it at the end, instead of the beginning.
I see. Thank you very much! I was confused with the word "trialing".
Yes, I have seen that form also.
Maxwell Chen
|
|
|
|
|
plz tell me the fuction to find the ip address of my own system and i m working in console application using winsock header file.thank you
|
|
|
|
|
|
Hi,
to get localhost name:
GetComputerNameEx
to get IP from name:
addrinfo host;
LPADDRINFO res;
host.ai_flags = AI_CANONNAME;
host.ai_protocol = IPPROTO_TCP;
host.ai_family = PF_INET;
host.ai_socktype = SOCK_STREAM;
getaddrinfo( sMachineName, NULL, &host, &res );
-----------
Mila
|
|
|
|
|
Debug/Dialer.exe : fatal error LNK1120: 4 unresolved externals
|
|
|
|
|
Can you be more specific
Do you see MSDN
|
|
|
|
|
Can you provide more information ? How can we help you with so limited information.
Did you link to all necessary libraries ?
|
|
|
|
|
hi,
i guess this is a simple probelem where u forgot to link with your .lib file.
in the linker error you can get the function names which are not resolve.
and include the .lib file in your project > settings > link > Object/Library modules.
enter your .lib file name here. and rebuild all
-
^-^
@|@
- redCat
|
|
|
|
|
maybe your error is(I guess)
you declare one function in header file but you havent this file in your code
like this:
this is one example
class CAnswer : public CDialog
...
...
public:
int test();
....
};
then you call this function in your file
void CAnswer::OnBnClickedButton2()
{
test();
you need to delete this function(test) or you need to write test(function)
}
Answer error LNK2019: unresolved external symbol "public: int __thiscall CAnswer::test(void)" (?test@CAnswer@@QAEHXZ) referenced in function "public: void __thiscall CAnswer::OnBnClickedButton2(void)" (?OnBnClickedButton2@CAnswer@@QAEXXZ)
Answer fatal error LNK1120: 1 unresolved externals
or maybe this function is in your code like this
int test()
{
return 0;
}
again you get this error
-----------------------------------------------
or you need to import lib file to your project
|
|
|
|
|
Can we convert dll to source code? if yes, how?? Please give me info on the same. Thanks in advance.
|
|
|
|
|
For unmanaged dlls,I dont think it is that easy. I am not aware of..
But You can use Lutz Roeder's .Net reflector for managed dlls.
rgds...mil10.
|
|
|
|
|
acemahesh@yahoo.co.in wrote: Can we convert dll to source code?
no.
actually, yes - but that 'source' is going to be in machine language.
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
Atleast tell me How we can convert dll to machine code?
|
|
|
|
|
Hi
So fare i know you have to set both
// View Size
SetWindowExt(x1,y1);
// device size
SetViewportExt(x2,y2);
my printing works well using:
...
// Map Mode
pDC->SetMapMode(MM_ISOTROPIC);
// View size
pDC->SetWindowExt(xres-20,yres-50);
// Device Size
pDC->SetViewportExt(pInfo->m_rectDraw.right,(int)(pInfo->m_rectDraw.bottom));
Draw(pDC,&page);
...
hope this could help you
|
|
|
|
|
Hi,
Is it possible to integrate the module developed in c#.net in vc++.net?
If yes, then please let me know how it is done and using what?
Archana Raj
|
|
|
|
|
FYI: Going forward Please Post all C++/CLI/Managed C++ queries under "(Managed) C++/CLI" forum. This is not a .Net forum.
Hope your C# module is an assebly/dll and not an exe/application.
If it is an assembly then you can use #using to include the C# dll into your code.
Then use the namespace declaration and create the class instance.
declaration part:
<br />
#using <csharpassebly.dll> <br />
using namespace csharpassebly::mycomponents; class instantiation:
CMyCSharpClass* objCMyCSharpClass = gcnew CMyCSharpClass();<br />
objCMyCSharpClass->method1();
If you c# module is an exe/application, then it is a diffrent story: use System.Diagnostic.Process class to invoke the process.
cheers...milton.
|
|
|
|
|
Thanks Milton
Mine was a .EXE and i could get that application in .net by creating the process using System.Diagnostic.Process.
can you tell me the way to creat a DLL for the existing vc++ application?
Thanks and regards
|
|
|
|
|
I am trying to convert an old application (VB3, NT4, RDM4.5) to C++2005, Win2003Server and RDM7.dll(programmed with native C++). I can export the DB functions and data without problems but trying to access the data with a key, I get errors. I have been using
#include "stdio.h"
#include "vcclr.h"
using namespace System::Runtime::InteropServices;
- - - - -
[DllImport("rdm7.dll", EntryPoint = "d_keyfind", CharSet = CharSet::Ansi)...]
extern "C" int d_keyfind(long, const void *, DB_TASK *, int);
- - - - -
String ^crpt = Currtmp.ToString();
pin_ptr<const wchar_t=""> tnoptr = PtrToStringChars(crpt);
- - - - -
d_keyfind(..., tnoptr, ...)
the program compiles without errors, runs other functions correctly, but with this d-keyfind I receive a KEY_NOT_FOUND error allthough Currtmp(long) is read with other functions from a real and existing record in the data base and although the direct access facility program (programmed in native code) reads the key value correctly and returns correct data.
Could anyone perhaps see what is my error here?
Thank you in advance!
I wonder if you can easily see an error here.
Ilkka Pitkänen
|
|
|
|
|
FYI: This query is a C++/CLI category. Going forward Please Post all C++/CLI/Managed C++ queries under "(Managed) C++/CLI" forum. This is not a .Net forum.
One thing I noted is the tnoptr you are passing. If your d_keyfind is expecting an ansi char instead of a wide char, then your code needs to bechnaged. Because PtrToStringChars returns a wchar_t. If that is the case you can try the following code:
char __nogc* szCurrtmp = static_cast<char *>(Marshal::StringToHGlobalAnsi(crpt).ToPointer());<br />
d_keyfind(..., (void*)szCurrtmp, ...);<br />
Marshal::FreeHGlobal( IntPtr((void*)szCurrtmp) );<br />
return bRtn;
rgds...mil10
|
|
|
|
|
Thanks for your reply Milton!
The program obviously needs ansi as in Extern C Marshalling the entry point for d_keyfind could only be found in the DLL with charset::ansi. Up till now I did not use any unmanaged code in the test program, so I have to spend a little time with __nogc and CLR linker options.
I let you know when I have tested your code sample.
Thank you!
Ilkka Pitkänen
|
|
|
|
|
Hi!
Have done some testing now which takes me to new, maybe trivial, situation. I have two questions:
1) As I amworking with CLI managed code, compiling the definition __nogc needs the /clr::oldsyntax switch for compiling. Maybe this could be given on the command line but as I am in the beginning of programming this application I wouldn't like to do that all the time when I make small changes to the code but instead would like to use build or F7 available in the main window of VS. Now I tried to change the project properties with ' project->properties->Configuration properties->General->Common Language Runtime support ' and changing the switch to "Common Language Runtime Support, Old Syntax (/clr:oldSyntax)". Having done this and back in building the code, I receive a lot of errors like with the first managed code class definition:
: error C2470: 'ref' : looks like a function definition, but there is no parameter list; skipping apparent body
Is there not a way to accept both /clr and /clr::oldsyntax together or do I need to compile the code separately which of course would be sad for the future development of the application.
2) This brings me to the apparent next question. You used static_cast for converting the pointer to a base class to a pointer of a derived class, if I get it right. As this type of conversion is quite new for me, I wonder could there be a possibility of using dynamic_cast, which (I think) would at the same time eliminate the need for clr::oldsyntax. Is there a way of using MarshalAsAttribute leading to AnsiBStr, I tried something but with no luck.
Thankful for any answer!
|
|
|
|
|
what is the maximum length that a CString can take? Doest is have any upper limits??
|
|
|
|
|
The maximum length of CString object is INT_MAX (2147483647) .
The secret of life is not enjoyment
but education through experience.
- Swami Vivekananda.
|
|
|
|
|
namaskaaram wrote: what is the maximum length that a CString can take? Doest is have any upper limits??
around 2GB
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Hi
Please suggest HTML supporting available in Visual C/C++
thanx in advance
by
KK
KK
|
|
|
|