|
I am creating a C++ App that uses ADO, problem is that it hangs at _ConnectionPtr.CreateInstance. i have tried looking up in goodle but havent been able to come up with a solution.
Below is my code.
any help would be greatly appreciated.
ADODB::_ConnectionPtr m_Conn;
BOOL ConnectionIsAvailable()
{
BOOL bRESULT = FALSE;
CoInitialize ( NULL );
try{
HRESULT hr =
m_Conn.CreateInstance(
__uuidof (ADODB::Connection ) );
if( FAILED ( hr ) )
throw _com_error( hr ) ;
m_Conn ->Open( L"DSN=DSNNAME",
L"",
L"",
ADODB::adConnectUnspecified );
bRESULT = TRUE;
}
catch(_com_error &e )
{
string sMess = "Error connecting to the database : ";
sMess += e.ErrorMessage() ;
WriteToLog( ( char* )sMess.c_str() );
}
return bRESULT;
}
|
|
|
|
|
Hzello evry body !
I have this problem :
I have C++ application with diverse dependencies upon libraries,etc
For many reasons, there is a certain central dir, where a post-build event script for each libs
copies the public .h files as well as the .dll and the .lib.
The client application only has to include the files in that dir and look for the libs as well in order to succesfully link.
My only pbm is when debugging this latter application. The call stacks shows problems happening in the code of some of those libraries, but the debugger source window never shows but the disassembly code.
Is there a way how to tell the debugger where to look for the source code ?
Thank you in advance.
Our Philosophy, Mohammed Baqir Al Sadr
|
|
|
|
|
How can I get the language identifier (maybe the term "keyboard layout" is more suitable) of a window that belongs to another application?
(e.g En, Fa, Ar, ...)
Thank you masters!
|
|
|
|
|
GetThreadLocale ?
Our Philosophy, Mohammed Baqir Al Sadr
|
|
|
|
|
Not for local thread, I said for a thread that has created a specific window (e.g foreground window) in another application.
Thank you masters!
|
|
|
|
|
In that case I do'nt think if there would be a certain GetLocale function that would accept a thread handle then retrieve the corresponding threads'locale, instead of the current thread that is calling the function.
May be if you manage to trigger that remote thread to execute specific code where you call GetThreadLocale, store its result and then somehow communicate it back then the pbm is solved.
Of course I am making the hypothesis that you can alter the target application source code.
Otherwise may be someone else has another solution.
Our Philosophy, Mohammed Baqir Al Sadr
|
|
|
|
|
for set the value i m using this.
CString tempstr ;
RegistryKey* softwareKey;
softwareKey->SetValue(S"Test", tempstr ,RegistryValueKind::String);
now error comes::
error C2664: 'void Microsoft::Win32::RegistryKey::SetValue(System::String __gc *,System::Object __gc *,Microsoft::Win32::RegistryValueKind)' : cannot convert parameter 2 from 'CString' to 'System::Object __gc *'
1> Conversion from a built-in type or a value type to pointer to __gc class or __gc interface requires boxing
Please help me for this.
Thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
It seems to me you are mixing C++ and managed code. Why are you doing that ?
|
|
|
|
|
I need to set the registry value please tell me how can i do this.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
|
Well, if you don't answer my questions, it will be difficult to help you... Why are you mixing C++ and managed code ?
|
|
|
|
|
Cedric Moonen wrote: Why are you mixing C++ and managed code
i have no idea about Managed code.
i dont know a proper use of this.
so i think by mistake i do this.
Tell me any other solution for this.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
After 9 months you still don't know how to search the articles on this site? There are plenty of solutions for registry access.
Rajesh's suggestion is also good but you will have to study the documentation of the Win32 registry API.
Nobody is going to write the code for you.
|
|
|
|
|
Michael Schubert wrote: Nobody is going to write the code for you.
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
Being able to distinguish between managed and unmanaged code maybe a prerequisite.
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi,
I have my application in MFC which is working fine on Windows Operating system.
Now i want to run the same application on Macintosh. I want to know do i need to make changes in my
code.
If yes what all things needs to be changed.
Or it can work perfectly alright without making any changes.
Thanks In Advance.
Dhiraj kumar Saini
|
|
|
|
|
Is it a console application using only standard C++ ? If yes, then the only thing you'll need to do is to recompile your application for MAC. Now if you are using things that are not cross-platform (like the MFC for instance), then you'll probably need to rewrite part (or everything) of your app. There are cross-platform GUI libraries like wxWidgets to do that.
|
|
|
|
|
Dhiraj kumar Saini wrote: I have my application in MFC which is working fine on Windows Operating system. Now i want to run the same application on Macintosh.
Your application will NOT work at all, on Macintosh. MFC is built around the Win32 API, which means it is not portable to another operating system than Windows.
If you want your application to work on multiple operating systems, then you must write it in plain C++, which should not contain a lot of operating system specific code.
For UI, you can use one of those open source frameworks, such as VCF[^], qt[^], wxWidgets[^], or something similar. Mind that you will have to compile it separately to build the specific binaries for each platform that you would want to deploy the app on.
In your case, it is not "changes" that you will have to make to achieve cross-platform execution, you must re-write your entire app.
PS: Your post looks ugly on my screen. Don't press the "Enter" key unnecessarily. The text will automatically wrap according to the screen resolution.
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
Thanks for the information.
|
|
|
|
|
What about Java?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Sounds like a plan. We can send him off the C++ boards then.
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
HI..how to create a web server using CAsyncSocket in VC++(MFC)..plz help ...
|
|
|
|
|
tns_ranjith wrote: how to create a web server using CAsyncSocket in VC++(MFC)
By implementing the HTTP protocol[^].
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
|
Here is a very old (circa 1996) article that describes how to write an HTTP/1.0 server using MFC: "Write a Simple HTTP-based Server Using MFC and Windows Sockets" by Dave Cook, February 1996 issue of Microsoft Systems Journal, at http://www.microsoft.com/msj/archive/S25F.aspx[^]
|
|
|
|