|
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.
|
|
|
|
|
Hello,
I have a web service un C# and a client in C++ that uses this web service without problems. Right now the aplication in VC++ is a simple console aplication and I need to modify it to make it a DLL. I have followed the basic steps to do this and also created another aplication (a console application also in VC++) that calls a function exported by my DLL to use the webservice but now when I try to run it I get the following error:
ATLSOAP: CSoapRootHandler::InitializeSOAP -- failed to get SAXXMLReader.
I don't get any errors when I compile my solition.
Unfortunately I haven't found any reference to this problem and I don't know what I am doing wrong.
Thank you so much for any help.
Yas
PS. I am using visal studio .net and .NET framework 1.1.
|
|
|
|
|
I created a c++ program that creates a dictionary file. the problem is that it won't go any larger than 4Gb. Is there any way around this limit?
|
|
|
|
|
I assume we are talking about NTFS here. Doesn't that system have a maximum volume size of 4GB? If not, then you are probably being plagued by the API you are using. The maximum size of an unsigned int is 4GB.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
If it does then how can I get around that max size? Is a way to create another file once that limit is reached?
|
|
|
|
|
Andrew Admire wrote:
If it does then how can I get around that max size?
Use a type that can store values larger than 232, perhaps.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Is there a way to generate files in C++? So I can get around the file limit size?
|
|
|
|
|
Technically, no. C++ knows nothing of file I/O. You can, however, use things like:
CFile
fopen()
CreateFile()
ostream But those will not get you any further than you already are.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|