|
Potato Software
Performance-wise only one step short of hand-typed machine code
|
|
|
|
|
Hi
I am useing ODBC 5.1 Driver for connect to MySQL.It's working fine for XP OS.I am getting error on Window Server.on server OS i an able to connect but after connection i am getting error.
Can't create an instance of Command
code
CString por="Driver={MySQL ODBC 5.1 Driver};";
CString Database="Database="";";
CString User="User=";
CString Userp=root;
CString password=";Password=";
CString Passwords=root;
CString option=";Option=3;";
CString final=por;
final +=Database;
final +=User;
final +=Userp;
final +=password;
final +=Passwords;
final +=option;
CoInitialize (NULL);
_bstr_t strCon(final);
try
{
HRESULT hr = m_pConn.CreateInstance (__uuidof (Connection));
if (FAILED (hr))
{
}
if (FAILED (m_pConn->Open (strCon,bstrString,bstrString1,0)))
{
AfxMessageBox ("Can't open datasource");
}
GetDlgItemText(IDC_EDIT4,m_cbrow);
GetDlgItemText(IDC_EDIT1,m_host);
if(m_host=="localhost")
{
}
else
{
MessageBox("There is an error to connect with MySQL. Please check your input parameters or server configuration.","Message",MB_ICONEXCLAMATION);
return;
}
AfxMessageBox ("Connection successfully");
_CommandPtr pCommand;
hr = pCommand.CreateInstance (__uuidof (Command));
<code>"Erro showing here"</code>
if (FAILED (hr))
{
AfxMessageBox ("Can't create an instance of Command");
return;
}
::_RecordsetPtr pRecordset;
pCommand->ActiveConnection = m_pConn;
Plz help me.
|
|
|
|
|
|
I have no idea.Plz help me
|
|
|
|
|
Hi All
How can i ReversFind and count number of words?I have CString name="agsdfgggggg" how can count and cut these part "gggggg" from name.
I mean i want to show this CString name="agsdfgggggg" to CString name="agsdf".
Can any one help me.
|
|
|
|
|
Is "agsdfgggggg" a unique string? Is there some pattern? Does it always have the same number of characters?
If you give us a bit more information we may be able to give you better advice than CString::Left(6) for example.
|
|
|
|
|
|
1 2 3 4 5 6
Sorry, couldn't resist...
|
|
|
|
|
I don't blame you.
|
|
|
|
|
Wow, I have no clue what you are talking about but the answer is probably liquid nitrogen[^]
Ok, serriously now. What does ReverseFind have to do with your question ? Why are you talking about words (I only see letters in your string) ? Is your string always "agsdfgggggg" and you always need to remove "gggggg" ? In which case, I don't see why you are asking the question
|
|
|
|
|
Cedric Moonen wrote: Is your string always "agsdfgggggg" and you always need to remove "gggggg" ? In which case, I don't see why you are asking the question
Have you ever tried to use agsdf when it was next to gggggg? It's difficult at best.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
|
What about
CString name = "agsdfgggggg";
int l = name.GetLength();
int count=0;
while (l-- > 0)
{
if ( name[l] != 'g') break;
count++;
}
if ( count > 0 )
{
name = name.Left(name.GetLength() - count);
}
?
[added]
Sorry for the poor answer, I didn't realize that correct one is LIQUID NITROGEN.
[/added]
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]
|
|
|
|
|
|
Let me restate your requirement.
You want the repeating character at the end to be removed.
If this requirement is correct, here is what you can do.
name = name.TrimRight(name[name.GetLength() - 1]);
Of course, you will need error checking, which I have omitted.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
If I have two HKEY handles how could I compare them?
How could I get the full registry tree path of an open HKEY?
I could not find between the Reg... functions any one
which could help me to solve above two problems.
|
|
|
|
|
I assume you want to read the registry keys and compare them. There's tons of articles on how to read values from the registry.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
no this is simple one and there are tone of articles.
What I want is to get what is behind the HKEY in therms of
path in the registyr tree.
For example If I open two HKEY to
HKEY_CLASSES_ROOT\*
How could I get from the HKEY handle this path:
HKEY_CLASSES_ROOT\*
And how could I compare the two HKEY handles to check
that they both are point to same path in the registry tree.
|
|
|
|
|
I think what Christian said is correct - you have to read the data (enumerate the keys and/or values) that each of your HKEY's point to to see if the paths etc are the same (ie by comparing the results of the enumeration) - since you dont 'know' where you are in the tree and likely cant make any assumptions, I think this is the safest bet ..
'g'
|
|
|
|
|
But with this proposal if there are two keys with same names/values
I should consider that both HKEY are the same.
This is very recursive solution which could take time to compare
each name/value of the sub keys.
Any other ideas?
|
|
|
|
|
> How could I get the full registry tree path of an open HKEY?
With Kernel apis.
|
|
|
|
|
Hi All,
How do test dll which is created in C.
I have created dll using .NET FRAMEWORK in C programming.I want to test my dll as well as Unit testing.How do i do that.Please gimme any idea...
Thanks,
Mohan.T
Mohan t
|
|
|
|
|
You need to create a test program that will use your dll...
|
|
|
|
|
mohant$.net wrote: I have created dll using .NET FRAMEWORK in C programming.
Interesting: how did you fit the C language inside the .NET framework?
mohant$.net wrote: I want to test my dll as well as Unit testing.How do i do that.Please gimme any idea...
You should build an application that uses the library, possibly stressing it a lot.
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]
modified on Tuesday, September 8, 2009 3:33 AM
|
|
|
|
|
Did you use .NET IDE for develop native dll?
Thanks and Regards,
Selvam,
http://www.wincpp.com
|
|
|
|