|
I look it over on my MSDN copy, but I didn't fully understand. As far as I understood, this error means that a class cannot have a pointer to another managed class, which really sounds to me rather absurd. That's why I posted this message, because I think somehow I didn't understand that quite well... Any thoughts?
Regards,
KK.
One day you'll find
that I have gone,
for tomorrow may rain, so
I'll follow the sun...
|
|
|
|
|
Hi all,
I want to let the user to select any time zone they like from the list of time zones.
I made some research to get the list of time zones..
some say, get it from register..
Would you please tell me how to get all avaliable time zone?
Thank you.
|
|
|
|
|
These Api will help:-
EnumTimeFormats<br />
EnumDateFormats<br />
EnumCalendarInfo<br />
EnumUILanguages
and for more Info visit this link:-
National Language Support[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
I get the following error message when trying to cout a variable of type __int64 in VC++:
" error C2593: 'operator <<' is ambiguous "
Why is this? How can I print variables of type __int64?
Thanks a bunch guys
|
|
|
|
|
Actually, let me tell you what I am trying to do. I am taking a number C to the D power mod N.
C is a 7 digit number, and D is a 7 digit number. As an example, C squared is a 13 digit number. Thats why I need a data type that can hold very large numbers, and I figured __int64 is what I need.
What algorithm woul you use here?
Thanks a lot.
|
|
|
|
|
cout doesn't overload the << operator with __int64 (I think because __int64 is a MS VC++ feature, not part of the C++ standard).
You can use _i64toa() to print them. Or if you want it to work with cout the following seems to work fine:
std::ostream& operator<< (std::ostream& ostrm, __int64 i)
{
char szBuff[65];
_i64toa(i, szBuff, 10);
return ostrm << szBuff;
}
int main(int argc, char* argv[])
{
__int64 i = 9223372036854775807;
std::cout << "i = " << i << std::endl;
return 0;
}
|
|
|
|
|
That's the problem: When the program running on a Windows Server 2003 cluster creates a resource of "Generic Application" type, it needs two properties to be set: command prompt and directory path.
I've studied MSDN back and forth and it didn't help.
Can anyone help with an example, please?
|
|
|
|
|
Sederik wrote:
I've studied MSDN back and forth and it didn't help.
Did you see this:
WCHAR szCommandLineData[] = L"c:\\bin\\myapp.exe";
CLUSPROP_SZ_DECLARE( CommandLineValue, sizeof( szCommandLineData ) / sizeof( WCHAR ) );
CommandLineValue.Syntax.dw = CLUSPROP_SYNTAX_LIST_VALUE_SZ;
CommandLineValue.cbLength = sizeof( szCommandLineData );
lstrcpyW( CommandLineValue.sz, szCommandLineData );
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Yes, I did. Unfortunately, I didn't understand how it could be linked to a specified resource.
I'll try to clear it: I have a ~10 Generic Application resources created and each of them uses different command. For each of them I run the above code, but I don't know how the resulting value can be set as a property for a resource.
|
|
|
|
|
I understand that I might be in a wrong place to ask this question, but if you do have an answer, please help me out thank you
I am trying to use Borland C++ Builder 6 to parse an XML file, and I couldnt find a way to get child nodes..
if you could, please provide me an example or show me how to
THank you
Elapid For The Win
|
|
|
|
|
I assume there is some sort of DOM implimentation in Builder, which means that you load the XML into a document class which provides selectnode type methods. You select nodes using XPath, perhaps a google of builder xpath would give more concrete info ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
How to access the variables declared in Doc.h from another .cpp?
(NOT accessed from View.cpp)
Thanks!
|
|
|
|
|
The proper way to do it would be to create a public method in the document's class that would provide access to the member variable. Something like:
class CMyDocument : public CDocument
{
public:
int GetSize( void ) const
{
return m_nSize;
}
private:
int m_nSize;
};
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
An oldie, but a goodie:
How To Get Current CDocument or CView from Anywhere
One you get the document pointer, you can access the data using the code similar to what David posted.
Pssst. You see that little light on your monitor? That's actually a government installed spy camera. Smile and wave to big brother!
|
|
|
|
|
|
Thank you very much! I was just confused. ^^
|
|
|
|
|
Hi,
I have been looking at connecting to MySQL databases for the past few hours and have it all working fine. However I am trying to retrieve information from my ini file that I have for my program and that works fine but when I try to put it into my MySQL Select command it causes an error and crashes the program. This is most likley a simple mistake on my behalf but could you please point me in the right direction. I am using the mysql++ library by the way. My code is as follows:
char szAuth[_MAX_PATH];
GetPrivateProfileString("Auth", "Key", "", szAuth, sizeof(szAuth),
"D:\\Programs\\Microsoft Visual Studio\\MyProjects\\Project12\\Debug\\IniDemo.ini");
std::cout << szAuth << "\n";
pConnection = mysql_init(NULL);
if(!pConnection) //error, quit the program
return 0;
printf("Attempting to connect\n");
if(mysql_real_connect(pConnection,"localhost","username","password","test",0,NULL,0) == NULL) //error, quit the program
return 0;
printf("Connected to the database\n");
mysql_query(pConnection,"SELECT * FROM auth WHERE auth=szAuth"); //query the database
pResult = mysql_store_result(pConnection);
printf("The Number of rows in the table: %d\n", mysql_num_rows(pResult));
mysql_free_result(pResult);
mysql_close(pConnection);
printf("Connection Terminated\n");
return 0;
|
|
|
|
|
If you're querying on a string in SQL, you need to wrap it in single quotes 'like this'.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
That was the first thing I tried but it just searches for szAuth in the database and not what the actuall value of szAuth is from the ini file.
|
|
|
|
|
MySQL is not going to pull values out of your ini file, you need to get the value and pass it, with quotes, to the database.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Thats what I am trying to do. The value from the ini is not pulled through the MySQL statement. I used 'GetPrivateProfileString' to get the value from the ini file before the MySQL string and called that value szAuth and I know it works because I printed szAuth to the screen its just when I try to put szAuth into the MySQL statement that it just tries to find szAuth and not the actuall value of szAuth.
|
|
|
|
|
*sigh* If you have a variable called szAuth, and you want to build an SQL search string for it, the search string needs the VALUE of szAuth in quotes. Like this:
"SELECT * from books where Author='" + szAuth + "'"
NOT
"SELECT * from books where Author=" + "szAuth"
and not
"SELECT * from books where Author=" + szAuth
either
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Oh right, sorry I did not quite understand what you meant. I have changed that but now I am getting an error about "cannot add two pointers." I am looking on google for what this is but if you could help that would be great. At the moment I understand its something to do with using the + but im not exactly sure what.
|
|
|
|
|
Use a class like string or CString to hold your query, because otherwise, you're trying to add two char*, and you can't do that. you could use strcat, but there's no reason not to use C++
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Ok, thankyou for all of your help.
|
|
|
|