|
Do you want to use on the C++ or C++.net?
|
|
|
|
|
hi,
i want to use in vc++
tanx
venu
|
|
|
|
|
You must use of LoadLibrary it returns a handle to file then call GetProcAddress function for gets address of function on the dll and in the end you must use of FreeLibrary function.
Does this informations helpful for you?
|
|
|
|
|
Hi all,
i am facing problem with AfxFormatString, as the the Parameters it will take from only "%1 to %9" as Arguments for subtitution from Resource String.
Please help me to Append beyond that, I Mean after 9 th Parameter.
code:
-----
Resource String :
String ID
---------
IDS_GTD_WIZ_SET_STANDARD_CONTROLLER
Caption
-------
"It is necessary to set one or more equipment other than %1, %2,\n%3, %4, %5, %6, %7, %8,\n%9 and %10 to Communication ettings."
Here i am trying to Subtitue this %1,%2,%3,%4,%5,%6,%7.... upto %9 but after subtituion of %10 i am not reflecting that.
CString lC_Str_DriverArray[10];
UINT lui_Index = 0;
lC_Str_DriverArray[lui_Index++].LoadString(IDS_GTD_WIZ_CONTROLLER_BARCODE);
lC_Str_DriverArray[lui_Index++].LoadString(IDS_GTD_WIZARD_REFID);
lC_Str_DriverArray[lui_Index++].LoadString(IDS_GTD_WIZ_CONTROLLER_GATEWAY);
lC_Str_DriverArray[lui_Index++].LoadString(IDS_GTD_WIZ_CONTROLLER_ETHERNETDOWNLOAD);
lC_Str_DriverArray[lui_Index++].LoadString(IDS_GTD_WIZ_CONTROLLER_PRINTER);
lC_Str_DriverArray[lui_Index++].LoadString(IDS_GTD_WIZ_CONTROLLER_VIDEORGB);
lC_Str_DriverArray[lui_Index++].LoadString(IDS_GTD_WIZ_CONTROLLER_RGBOUTPUT);
//Extended Step Addition
lC_Str_DriverArray[lui_Index++].LoadString(IDS_GTD_WIZ_EXTENDED_MEMORYCARD);
lC_Str_DriverArray[lui_Index++].LoadString(IDS_GTD_WIZ_SOUND_OP_UNIT);
lC_Str_DriverArray[lui_Index].LoadString(IDS_GTD_WIZ_EXTERNAL_IO_UNIT);
//Load error message
AfxFormatStrings(lC_Str_Msg,IDS_GTD_WIZ_SET_STANDARD_CONTROLLER,(LPCTSTR*)lC_Str_DriverArray,10);
Here after 9th String i am getting Problem. in %10 it is subtituting as %1 what to do.
please help me out.
Uday kiran
|
|
|
|
|
I would advise you to use boost::format[^]
Boost is a library of very high standards. So high, parts of it will find its way into the upcoming C++ standard. It is completely free.
Another possibility is building your message in a std::ostringstream, and get it from there.
std::ostringstream stream;
CString tmp;
stream << _T("It is necessary to set one or more equipment other than ");
stream << (LPCTSTR)tmp.LoadString(IDS_GTD_WIZ_CONTROLLER_BARCODE);
...
std::string s = stream.str();
CString s1 = s.c_str();
Failure is not an option - it's built right in.
|
|
|
|
|
hi jhwurmbach,
I Understand your answer. But the Code T("It is necessary to set one or more equipment other than "); must not be hard coded and this is the String Table of the Resource with %1 %2 %3 .....
and Dynamically it must subtitute accordingly.
please let me know any solution for this.
Uday kiran
|
|
|
|
|
OK. I see.
You got the text with the %1-replace markers inside and can not change it.
How stupid!
You could have a regex[^] exchanging all '%digit' by '%digit%' and use something like this
cout << boost::format("writing %1%, x=%2% : %3%-th try") % "toto" % 40.23 % 50;
(example from the boost-page)
Ok. This idea comes out of desperation.
Failure is not an option - it's built right in.
|
|
|
|
|
How can i get the sum for col2 ?
i have a CListCtrl m_list
--------------------------
|Col0 | Col1| Col2 |
--------------------------
| 10 | 2 | 1 |
--------------------------
| 10 | 2 | 1 |
--------------------------
all i want is to get the sum from col3 = 2
m_list.GetItem(...);
s1.Format(....);
AfxMessageBox(s1); // =2 from (Col3)
How Can i get the result?(from Col3); (sum)?
Bravoone
|
|
|
|
|
Wasn't one copy of your question enough?
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
|
Check your previous question - I provided enough code to get you going down the right path.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
IS there any Windows API for setting the ACL of a file . . .
Proud To Be an Indian
|
|
|
|
|
vivekphlp wrote: IS there any Windows API for setting the ACL of a file . . .
Yes. Check out SetNamedSecurityInfo() .
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
See this[^] articles is helpfuls?
|
|
|
|
|
Someone can recommend me a free and easy setup maker for Visual C++ aplications?
-I have used InstallShield but is too complicate for me.
-I used Inno Setup but makes some strange things... After making the installer and installing the app it only shows a Messagebox that says "Welcome to my aplication" and then closes. O_o
-I used too Smart Install Maker but it is not free, and shows a window during installation of the app that says "This is made with a no paid program" or something like that. Of course, I cannot use it...
Any other idea?
Thanks
Time to come clean...
Vive y deja vivir / Live and let live
Javier
|
|
|
|
|
|
whats the difference between
char test[] = "Hello";
and
char* test = "Hello";
in both cases is "Hello" allocated on the stack??
|
|
|
|
|
Haroon Sarwar wrote: char test[] = "Hello";
This is an array of characters. This is not a pointer.
Haroon Sarwar wrote: char* test = "Hello";
This is a pointer to an array of characters. Note that test will contain the address of the given array and not the real data.
For proof enter the following in the debugger
&test
test
ptest
&ptest
You will see that the first two are same, but the last two are not.
|
|
|
|
|
There are notable differences between:
Haroon Sarwar wrote: char test[] = "Hello";
Here test is a character array(i.e. a const pointer to a memory area containing six characters -remember the '\0' string terminator-), initialized with the string literal "Hello" .
Haroon Sarwar wrote: char* test = "Hello";
Here test is a pointer to the string literal "Hello" , that is a read-only memory area.
See the following sample code:
char test1[] = "Hello";
char * test2 = "Hello";
test1[2]='p';
test2 = test1;
test2[2]='p';
Hope that helps
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.
|
|
|
|
|
If you do these within a function they will both get allocated on the Stack, one array and one pointer. The actual "Hello " text in each case will end up as static data within the executable image. char text[] = "Hello"; will give you an on stack copy of this data at runtime. const char* test = "Hello"; will give you a pointer to the string stored in the image memory. char* test = "Hello"; will almost certainly be the same.
If you do these at file scope, i.e. in a .c or .cpp file but not in a function then the "Hello" text is still stored in the image and in this case so is test[] or test. With a reasonable optimising compiler with string merging char* test; will probably end up pointing to the same memory refered to by char test[] which will be the one and only original "Hello" text in the loaded image.
Have a look in the debugger at runtime and see what the address values are in each case. You'll soon spot the pointers to stack memory as opposed to pointers into the loaded image, the ranges will be quite different.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
See here.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
How can i get the result ?
i have a CListCtrl m_list
--------------------------
|Col1 | Col2| Col3 |
--------------------------
| 10 | 2 | 1 |
--------------------------
| 10 | 2 | 1 |
--------------------------
all i want is to get the result from col3 = 2
m_list.GetItem(...);
s1.Format(....);
AfxMessageBox(s1); // =2 from (Col3)
How Can i get the result?(from Col3);
Bravoone
|
|
|
|
|
Bravoone_2006 wrote: How Can i get the result?(from Col3);
as follows
CString csText = GetItemText(1,2);
AfxMessageBox(s1);
nave
|
|
|
|
|
no you dont understand i need row1+row2 = s1(or can be more than 2 rows)
How?
Bravoone
|
|
|
|
|
you mean you want to get the sum of integers in all columns of row1 and row2?
nave
|
|
|
|