|
No i dont change any function signature ,i just fix bugs only. the problem is that as i learn .obj is only compiled file and it is not linked with library when we execute our porgram than it link with library and gives executable file. (.exe ).but in my case it give linking error.
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|
|
Shilpi Boosar wrote: the problem is that as i learn .obj is only compiled file and it is not linked with library
the .obj contains the necessary info to perform the function calls to your DLL at runtime hence, if you're stuck with original signatures (and exports) then you shouldn't experience problems. BTW Why don't you post the error message?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
i know thats y i said that i dont change any signature of API that is exported .i just fix bugs.
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|
|
OK, to summarize, all the info I got from you, are: "I fixed bugs". Hence, all that I can deduce is that your executable works fine, congratulations!
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
No mam that is the main problem that program is not working .
any ways thanks
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|
|
what linker error are u gettin. please post the error so that we can get more clarity over your problem. CPallini Has asked to two times to post the error!
We are eager to help but you are not letting us
There are only two kinds of people who are really fascinating-people who know absolutely everything, and people who know absolutely nothing.
Oscar Wilde (1854-1900)
Regards...
Shouvik
|
|
|
|
|
Shilpi Boosar wrote: No mam that is the main problem that program is not working
Oh, that means you're unlucky, kid.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
I am writing the following code for creating the XML file.
HRESULT hr;
IXMLDOMDocumentPtr pXMLDoc = NULL;
CoInitialize(NULL);
hr=pXMLDoc.CreateInstance("msxml2.domdocument");
IXMLDOMNodePtr pRootNode= NULL;
IXMLDOMNodePtr pRecNode= NULL;
IXMLDOMNodePtr pRecNode1= NULL;
IXMLDOMElementPtr pElement=NULL;
_variant_t varNodeType((short)MSXML2::NODE_ELEMENT);
hr= pXMLDoc->createNode(varNodeType,
_T("RTCS"), _T("Remote Target Control System"),&pRootNode);
hr=pXMLDoc->createElement(_T("Connection"),&pElement);
IXMLDOMAttributePtr pRecIdAttr = NULL;
IXMLDOMNamedNodeMapPtr pattributeMap;
hr=pXMLDoc->createAttribute(_T("connect"),&pRecIdAttr);
hr=pRecIdAttr->put_nodeTypedValue(_variant_t(_T("connect_val")));
hr=pElement->get_attributes(&pattributeMap);
hr=pattributeMap->setNamedItem(pRecIdAttr,&pRecNode);
hr=pXMLDoc->appendChild(pRootNode,&pRecNode);
but i am not able to see the child node created in the xml file.Only root node is created:
The xml file i want to create is:
?xml version="1.0"?>
<rtcs name="Remote Target Control System">
<Connection connect= "connectval" ipaddress = "ip_addresss" Port = "port_number"/>
<Logging Directory="path" Level="level" ComPort="port_number" Maxsize="max_size"/>
<Video BitRate="bitrate" InputType="input_type" Preview="preview" FrameDrop="frame_drop" Dumping ="dump"/>
<IR directory_path="dir_path"/>
</rtcs
Regards,
|
|
|
|
|
If you are CREATING an entire XML file, why not do it using string classes instead of all that messy COM stuff ?
Why on earth do you bother to grab the HRESULT returned, if you never check it ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi
In my VC 6.0 programme I used Sqlserver with ODBC connection.
Connection and the retrieving data from the Server was ok.
But initially when I executing it ask for the Server login and password for the Sql Server.
Can any tell me about giving the Sql Server login id and password through Coding itself.
(In programme I used CDatabase, CRecordset)
Awaiting for your suggestion of this.
Regards
shakumar
shakumar
|
|
|
|
|
Here below is the code snippet to directly give uid and pwd
#define CONNECT_STRING _T("DSN=xxxxxxxxxxx;UID=cccccccc; PWD=ccccccccccc")
m_pDBConn = new CDatabase();
BOOL w_bIsOpen = FALSE;
if(m_pDBConn)
{
try
{
//opens a connection to the data source
w_bIsOpen = m_pDBConn->OpenEx(CONNECT_STRING);
.......................
But with this way, you can not change your database password, with out rebuilding the application. The best way is to add two fields (uid and pwd) in the registry and read it from there. With this you can change uid and pwd with out rebuilding the application. But you need to encrypt the uid and password in the system registry, else any one can hack it.
|
|
|
|
|
Its working properly and very thanks ful for this
shakumar
|
|
|
|
|
Hello everyone,
If I want to convert LPCTSTR and HRESULT to standard C/C++ data type (like char*, int, long, etc.), I am wondering what standard data types should I convert to be safe and do not lose and data precise?
thanks in advance,
George
|
|
|
|
|
|
Thanks Shilpi,
I found from winnt.h that HRESULT is defined to long. But I can not find the definition of LPCTSTR. Could you find it out?
regards,
George
|
|
|
|
|
For unicode it is CONST WCHAR *
and for latin CONST CHAR *
i think now it is helpful for u.
long pointer to null terminated string
LPCSTR Pointer to a constant null-terminated string of 8-bit Windows (ANSI) characters. For more information, see Character Sets Used By Fonts.
This type is declared in WinNT.h as follows:
typedef __nullterminated CONST CHAR *LPCSTR;
LPCWSTR Pointer to a constant null-terminated string of 16-bit Unicode characters. For more information, see Character Sets Used By Fonts.
This type is declared in WinNT.h as follows:
typedef CONST WCHAR *LPCWSTR;
LPCTSTR An LPCWSTR if UNICODE is defined, an LPCSTR otherwise.
This type is declared in WinNT.h as follows:
#ifdef UNICODE
typedef LPCWSTR LPCTSTR;
#else
typedef LPCSTR LPCTSTR;
#endif
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|
|
Thanks Shilpi,
I do not know it is const before, so I can not change the value of the string, right?
What means long pointer (for 1st letter L in LPCTSTR)?
regards,
George
|
|
|
|
|
<big>Acronym Definition</big>
LPCTSTR Long Pointer to a Constant null-Terminated String
There are only two kinds of people who are really fascinating-people who know absolutely everything, and people who know absolutely nothing.
Oscar Wilde (1854-1900)
Regards...
Shouvik
|
|
|
|
|
Thanks shouvik,
Long pointer means? What is the difference between long pointer and a normal pointer?
regards,
George
|
|
|
|
|
The L bit is a historical hangover from 16 bit windows - it no longer has any extra meaning, but as the function prototypes for windows use it, it was kept on.
There used to be near and far pointers in the old days... sigh, segments....
Iain.
ps, I don't miss this old days, either!
|
|
|
|
|
Thanks Iain,
For 32-bit or 64-bit machine, I do not need to consider it, right?
regards,
George
|
|
|
|
|
Yeah of course. Pointers are very specifically address holders. The size of the pointers are dependent on the compiler too. While developeing 64Bit Applications the size of default pointer is 64.
Take this as a thunb rule. All sizeof are never constant-> they vary as per the compilers they are used in. If int is 2 byte in TurboC++ 3.0 it will be 4Bytes in VC++... Hope u can undestand my point.
There are only two kinds of people who are really fascinating-people who know absolutely everything, and people who know absolutely nothing.
Oscar Wilde (1854-1900)
Regards...
Shouvik
|
|
|
|
|
Thanks shouvik,
I want to confirm your point that data type LPCTSTR works for both 32-bit and 64-bit transparently? Means developer could use the unified data type LPCTSTR without considering whether working on 32-bit or 64-bit platform safely?
regards,
George
|
|
|
|
|
That is really a novel idea. But upto my knowledge (which is bit of a dumb kind ) all 64 bit OS handle 32 bit data safely. I mean there is a back compatibility available which would allow safe usage without any data loss. I think they do padding and all to convert the 32 bit data to 64 bit.
If you really want to see if LPCTSTR works fine with both 64 bit and as well 32 bit transparently then develop an Appl in 32 bit compiler and then try executing it in 64 bit. I am a bit vague about further details regarding 32 bit and 64 bit compatibility issues.
There are only two kinds of people who are really fascinating-people who know absolutely everything, and people who know absolutely nothing.
Oscar Wilde (1854-1900)
Regards...
Shouvik
|
|
|
|
|
It is ok. Thanks for your support for all the help you given to me on the question all the way.
regards,
George
|
|
|
|