|
this is very lame code. You better make at first the output string with CString (or otherwise) and at last ::SysAllocString()
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
What code you have written if you have to append the BSTR. It's a humble request from programmer to professional.
“You will never be a leader unless you first learn to follow and be led.”
–Tiorio
"Coming together is a beginning, staying together is progress, and working together is success." Henry Ford
|
|
|
|
|
I would first make a complete string in a CString or TCHAR-array and at last create a BSTR.
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
i need a vc++ program for playing an audio file
|
|
|
|
|
Use PlaySound[^] API
PlaySound(TEXT("recycle.wav"), NULL, SND_FILENAME);
|
|
|
|
|
Well, this forum is not exactly a software shop...
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]
|
|
|
|
|
|
How I get groups and the number of associated users in that group of a system.
Regards
“You will never be a leader unless you first learn to follow and be led.”
–Tiorio
"Coming together is a beginning, staying together is progress, and working together is success." Henry Ford
|
|
|
|
|
Check out NetGroupEnum and NetGroupGetUsers APIs.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Mogaambo wrote: How I get groups and the number of associated users in that group of a system.
Furthur to Superman's answer, use NetLocalGroupEnum[^] and NetLocalGroupGetMembers[^] to retrieve a list of the members of a particular local group in a local machine/system.
Mogaambo khush huvaa ? 
|
|
|
|
|
Hi all,
i have SDI type application,and split it in two columns.
for one column i m using a Treeview and for another one i m using a FormView.
in toolbar two buttons functions override in Treeview class because they are related to treeview here i m inserting,deleting the tree items.
when i focus on formview and than click on those toolbar buttons than they are not working ,while when i have focus on TreeView and than click on those buttons than those are working perfectly.
please tell me how can i use as general.
if possible please explain me with example.
thanks in advance.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
|
lek258 wrote: Creating ISO9660 Image File(URGENT PLEASE)
What variable type is "URGENT PLEASE"?
Maybe this works:
void Creating ISO9660 Image File(int URGENT PLEASE);
.
.
.
.
void Creating ISO9660 Image File(int URGENT PLEASE)
{
return;
}
|
|
|
|
|
I think many (ab)users of this forum would benefit from the following piece of code:
char *answerForumQuestion(char *requestString, bool isUrgent)
{
if (isUrgent)
if (rand() % 2)
return NULL;
else return ptrToRequestStringErrorMessage;
if (isClear(requestString) && showEffort(requestString))
{
if forumReaderUnderstands(requestString)
return formulateAnswer(requestString);
}
return NULL;
}
During execution of this post, rand() returned 10......
|
|
|
|
|
Hi All, i want to write a code to read a complete string. The code i have written reads the first word of every string. What all modification is it required to do the same? I am ucing MFC for the same.
Thank u all
French is the language of love, for everything else there is c++ ...(anonymous)
|
|
|
|
|
|
dubeypankaj wrote: The code i have written reads the first word of every string.
Your code to read string may have a bug! That may be stop reading on each SPACE character.
You can use strlen to find the length of the complete string.
dubeypankaj wrote: I am ucing MFC for the same.
In MFC the string manipulations are done with CString class.
|
|
|
|
|
Your question is not clear.
Where are you reading from? File? Standard input?
How are you reading it? scanf? cin?
I'm assuming that you are reading from standard input, ie, user input.
If you are using scanf , you can do this -
char sz[1024];
scanf("%[^\n]", sz);
If you are using cin , you can do this -
string s;
getline(cin,s);
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
No, I m not using cin or scanf, i am reading data from a text file, and storing the outputs in arrays and again giving these array values as input to the textboxes so as to get an onscreen display of tht perticular text box.
French is the language of love, for everything else there is c++ ...(anonymous)
|
|
|
|
|
You can getline on the file stream to read one line at a time.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
fopen("some_file.txt","r");
Search(fp_mt2, "Text: 2", "xyz");
for(i = 0; i < 10; i++)
{
fgets(line_buffer, 200, fp_mt2);
j=0;
while(line_buffer[j]!='(')
{
j++;
}
j = j + 2;
mt2[i] = line_buffer[j];
}
m_txt = mt2[0];
" " " " " "........ some 10 times w.r.t every value of mt2[j]
m-txt is the textbox. But i am getting only first character of every string of every line. The string carry 2 or 3 characters.
j = to reach the perticular line.
would u please help me further.
French is the language of love, for everything else there is c++ ...(anonymous)
|
|
|
|
|
Your last post was very confusing.
I didn't quite understand.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Yes it is! 
|
|
|
|
|
sorry for the same...
fopen("some_file.txt","r"); // opening the text file to read
Search(fp_mt2, "Text: 2", "xyz"); // search string xyz after string Text
for(i = 0; i < 10; i++) // reading 10 strings from 10 lines
{ // (starting string from each line)
fgets(line_buffer, 200, fp_mt2); // reading a line here
j=0;
while(line_buffer[j]!=':') // starts reading after ':'
{
j++;
}
j = j + 2;
mt2[i] = line_buffer[j]; // storing the string in an array
}
m_txt1 = mt2[0]; // output: displaying first string
m_txt2 = mt2[1]; // output: displaying second string
..............
..............
m_txt10 = mt2[9];
m_txt is the textbox.
now, i want to read a complete string but i am getting only first character of every string of every line.
where each string carry 2 or 3 characters.
would u please help me further, now ?
French is the language of love, for everything else there is c++ ...(anonymous)
|
|
|
|
|
Send an example of your text file. I don't think people here has understood your file format.
|
|
|
|