|
We have a large MFC program that uses ODBC to connect to SQL Server, Oracle and My SQL databases. To make the connection we have a database management layer that uses the SQLConnect function in sql.h from the ODBC API.
I am starting to compile some of the DLLS using /CLR so that I can program in C++/CLI and use some of the .NET classes like OdbcDataAdapter so that I can use the DataGrid.
Is there any way that I can use my existing SQLHANDLE or should I create a second connection to the database by creating a .NET OdbcConnection?
-Tim
|
|
|
|
|
Hi,
I would like to know if there's a way to determine if a DLL is a managed class library or not, *without* loading it.
I don't want to use code like the one below to load the assembly, I just want to check it's type.
bool IsManagedDLL(String ^ fn)
{
try {Assembly::LoadFile(fn);}
catch(...) {return false;}
return true;
} Is there any way to do it?
|
|
|
|
|
http://geekswithblogs.net/rupreet/archive/2005/11/02/58873.aspx
|
|
|
|
|
Thanks alot, i'ts just what i was looking for
|
|
|
|
|
You are welcome
|
|
|
|
|
Hi,
I have taken a Dialog based Application. Upon some button Click I have some functionality to be done like creating a directory with Security attributes of a given user. Once I build this I got an Executable File which I Invoke from another Dialog based Application in Managed C++.
I invoked this executable (or process) by giving permmisions for an user say MyUser.
Process::Start(exepath,path ,username,strSecurePwd,domain);
So whatever is done in the executable file is being done by the MyUser.
Now, what I want is I have to Place all my functions in an
Executable File (or Seperate process) which should not have GUI.
Once I Invoke this Process all the functions in that should execute.
So, what sort of application I need to take for this to happen?
Any Suggestions or an approach to proceed would be helpful.
Thanks In Advance.
Today is a gift, that's why it is called the present.
|
|
|
|
|
Make a program that starts minimized and doesn't show in taskbar
|
|
|
|
|
//
int x=0, y=1, z=2;
printf("%d\n", --x&&--y||--z);
printf("%d, %d, %d\n", x, y, z);
//produces an output of
// 1
// -1, 0, 1
//then
int x=0, y=1, z=2;
printf("%d\n", -- |--y&&--z); //<--------- here!!!
printf("%d, %d, %d\n", x, y, z);
//produces an output of
// 1
// -1, 1, 2
//whats the difference?
//arielpirante@yahoo.com
|
|
|
|
|
This is a forum for "managed" C++ questions. Your posts do not appear to be about managed C++ issues. You should use the "Visual C++ / MFC" forum. It is the closest thing to a plain C++ forum that we have.
It appears you are a student in a CIS course. Make sure your read the material provided as many times as it may take to understand it. This is the essence of the problem you face.
|
|
|
|
|
how would i know if a series of binary number is negative?????
|
|
|
|
|
cOOLcOmbo wrote: how would i know if a series of binary number is negative?????
When is a number not a binary number?
|
|
|
|
|
and how do you define negative on those "binary number"s?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
//this code (c++)
int x=0, y=1, z=2;
printf("%d\n", --x&&--y||--z);
printf("%d, %d, %d\n", x, y, z);
//produces an output of
// 1
// -1, 0, 1
//which is logicaly correct
//then i changed it into
int x=0, y=1, z=2;
printf("%d\n", -- |--y&&--z); //<--------- here!!!
printf("%d, %d, %d\n", x, y, z);
//produces an output of
// 1
// -1, 1, 2
//WHY????????????
|
|
|
|
|
Since you have the OR (||) once a true ccondition is found the rest is not evaluated. So when --x is calculated to be -1 it is no zero and a true condition so the right side of the or does not need to be done.
|
|
|
|
|
Hello,
I create a "MFC application" project in MSVC 2005.
But I want to add a class ref from tThread.
For example,
public ref class tThread
{
public:
XXXXXXXXXXXXX
};
I add this code in the Form1.h.
But it has a default class From1.
I create a new header file to include.
#include "mythread.h"
But it come some errors.
This is mythread.h
///////////////////////////
#ifndef MYTHREAD_H
#define MYTHREAD_H
public ref class tThread
{
public:
static void Threadsend();
}
#endif
/////////////////////////////
This is mythread.cpp
#include "mythread"
using namespace System::Threading;
static void Threadsend(){
Thread::Sleep( 0 );
}
What's wrong with my code or are there better method to do it?
Appreciate your reply.
Thank you.
Jane
|
|
|
|
|
Please post on the correct form, you are much more likely to get an answer.
|
|
|
|
|
I move the code in mythread.cpp to mythread.h.
Then it works.
I think I had the problem before just because I dont understand
how to create my own header file completely.
-- modified at 6:43 Thursday 25th October, 2007
|
|
|
|
|
Hi all,
I tried the follwing connection string to connect with my local sql server "mySQLConnection = new SqlConnection(S"server=.;Trusted_Connection=yes;database=pubs;");" , it works well for me,now i am trying to connect with an sql server database presented in an remote system, also how to mention the username and password of the data base to communicate. Can any one suggest me some samples/links where can i get idea's
Thanks in advance
Know is Drop, Unknown is Ocean
|
|
|
|
|
|
Thousands of thanks for you help. It really help me not only for sql, for all database. Thank you once again
Know is Drop, Unknown is Ocean
|
|
|
|
|
You are welcome
|
|
|
|
|
|
I have an global function and I want to send a message to the actual window. With unmanaged C++ I did it with PostMessage(::GetActivWindow,....) and in the active window I catched the messae with ON_MESSAGE(...).
But how can I do this in managed C++ and Windows Forms?
|
|
|
|
|
How can I make a System Beep with managed C++?
|
|
|
|
|