|
Two people have told you the same thing now. Perhaps if you told us the EXACT error message. Also, please note, you should have asked this in the SQL forum.
Are you getting an error trying to build the string ? If you're not getting that error, you're not even using C++. In C++ you need to turn the int into a string, with sprintf, or with the Format method on CString, or with itoa. If you're using a .NET language, then it will work, but again, in that case, you have asked in a forum that has NOTHING to do with your question. In that instance, you need to look at your database. If your column is a numeric type, then the SQL you're generating, will work.
The best test is to use the debugger to get the exact string you are generating, and then plug that into your database directly, so your code is out of the picture, and you're just testing the SQL.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
And why on earth is this in the MFC forum ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi everybody!, I want to write a MFC application can create a hidden folder, but I don't know have any function allow me can do that.Thus, I hope if someone know,please tell me how to do it. Thanks alot
AS84
|
|
|
|
|
|
Please let me know how do I pass a string class string variable to a function...
Suppose
in main function
string str1("Hello");
creating a function outside main
new_function (----------)
{
.....
}
how do I pass word "Hello" to the new_function()
Please help me out.
Thanks.
|
|
|
|
|
Two different ones:
void new_function(string s)
{
}
or
void new_function(string & s)
{
}
depending on your needs.
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
|
|
|
|
|
Replace the first option by:
void new_function(const string& s)
{
}
This achieve the same result but is more efficient: you don't duplicate the object you pass to the function. The end result is the same (and even safer) because if you were trying to modify the string (in your option), this would have no impact over the original object. With passing the object as a const reference, you ensure that what is in the fact won't try to change the object.
|
|
|
|
|
you can try str1.c_str();but this is not preferred.
A Chinese VC++ programmer
|
|
|
|
|
How use from Dll in VC++?
I have a Dll that into have a class and i will use from methods.
How define instances and variable?
Is solution LoadLibrary?
How in GetProcAddress Define a instance from Class?
|
|
|
|
|
Do you have header and library file for the DLL. If so then include the header file and link with the library file. This[^ article have step by step instructions for how to do this.
-Saurabh
|
|
|
|
|
|
I have some COM client code that I am trying to write
IAdd *pAdd = NULL ;
IClassFactory *pClassFactory= NULL ;
IUnknown *pUnknown = NULL ;
if (SUCCEEDED(CoInitializeEx(NULL, COINIT_APARTMENTTHREADED)))
{
HRESULT res = CoCreateInstance(g_MotAutoplaycfgCLSID , NULL , CLSCTX_ALL , IID_IUnknown , (void **)&pUnknown);
res = CoGetClassObject(g_MotAutoplaycfgCLSID , CLSCTX_ALL , NULL , IID_IClassFactory , (void **)pClassFactory );
if(res == E_NOINTERFACE )
{
int x = 1;
}
else if(res == E_INVALIDARG)
{
int r = GetLastError() ;
}
}
I can get this to retrive a valid pointer for pUnknown
HRESULT res = CoCreateInstance(g_MotAutoplaycfgCLSID , NULL , CLSCTX_ALL , IID_IUnknown , (void **)&pUnknown);
However I am unable to obtain the interface Handle to IAdd Interface.
On the Server Side I can see that the ClassFactory class is created and that the Coclass is also instantiated.
Help is appreciated
Engineering is the effort !
|
|
|
|
|
You can use pUnknown->QueryInterface(.. , IAdd, ....)
Tarmo.
|
|
|
|
|
What is the error you get?
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
|
|
|
|
|
I was able to modify my client code to do this
if (SUCCEEDED(CoInitializeEx(NULL, COINIT_APARTMENTTHREADED)))
{
HRESULT res = CoGetClassObject(g_MycfgCLSID , CLSCTX_ALL , NULL , IID_IClassFactory , (void **)&pClassFactory );
if(SUCCEEDED(res))
{
res = pClassFactory->CreateInstance(0,IID_IAdd , (void **)&pAdd);
pClassFactory->Release();
}
else if(res == E_NOINTERFACE )
{
int x = 1;
}
else if(res == E_INVALIDARG)
{
int r = GetLastError() ;
}
CoUninitialize();
}
The call to
HRESULT res = CoGetClassObject(g_MycfgCLSID , CLSCTX_ALL , NULL , IID_IClassFactory , (void **)&pClassFactory );
succeeds providing a pointer to IClassFactory
However this line
res = pClassFactory->CreateInstance(0,IID_IAdd , (void **)&pAdd);
returns the following error
#define REGDB_E_IIDNOTREG _HRESULT_TYPEDEF_(0x80040155L)
Engineering is the effort !
|
|
|
|
|
It states the class you're asking for is not registered.
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
|
|
|
|
|
Hey Friends
I have a search provider for which i need to create an installer
Found a way to do from webpage for internet explorer
i hope this will work for all browsers (not sure)
checked in firefox & it worked
now what i am looking at is install a search provider for all browsers using c++ or some other way in which i can create a setup & user does not have to go to the page & install the new Search Provider
and finally new Search Provider is available to all browsers.
Any idea?
http://www.microsoft.com/windows/ie/searchguide/en-uk/default.mspx?dcsref=http://runonce.msn.com/runonce2.aspx[^]
Regards
|
|
|
|
|
|
You can get a good reference book, they are always handy, and start trying to make a specific program you can think of it... don't try something that is too hard, start from basic things and once you find a problem ask a specific question here and a lot of great guys will come to your help...
Be sure to post a clear and well formed question and it will be better...
Here you have plenty of articles speaking about different topics, they are separated in levels so you can find some that are for novice people.
You are welcome to this family/community...
Good luck!
|
|
|
|
|
tuneroz wrote: i ve really searched but no reply from friends and from webs
You can ask your questions here and usually you can get your asnwers.
See www.Cplusplus.com[^].
|
|
|
|
|
thanks 4 the help my big bro.am really grateful.........
tuneroz
tuneroz
|
|
|
|
|
You're welcome,I think its good point for start.
|
|
|
|
|
Google is your friend [^].
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
|
|
|
|
|
CPallini wrote: Google is your friend
Im not sure!
|
|
|
|
|
You're probably right. Anyway, perhaps Google will be his new friend.
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
|
|
|
|