|
Those links are actually helpful, because they give you C++ wrappers for SAFEARRAYs that will simplify the job of converting the SAFEARRAY to some other array of strings.
CComSafeArray<BSTR> safearrayOfBstr(((VARIANT)data).parray);
will wrap the SAFEARRAY contained in the VARIANT.
You can then use the CComSafeArray methods to access the SAFEARRAY data.
This article[^] is very useful, because it gives easier access to 2D SAFEARRAYs, which is what you've got here.
Thing is, it's up to you to do that final step of converting to your CStringArray - but all you need to do is iterate through the relevant elements of the SAFEARRAY, extract the BSTR, convert it to a CString and store that in your CStringArray - not tricky, really!
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hello All,
I am using wua api.
1)using IupdateSearcher->Searcher I am searching updates that are require,
2)After that I getting download url of respective updates.
3)using UrlDownloadToFile i am downloading .exe .cab .psf file for respective updates.
Now I want to install these file to PC (.exe,.psf,.cab) how should I do please help me.
I know i updates install but I want to do it above way.
Thank You All,
ashish p.
|
|
|
|
|
exe is obvious - run it with ShellExecute or CreateProcess.
A cab file is an archive that needs to be unpacked before you run some installer inside it.
No idea what a PSF file is?!
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Thanks for reply
cab file containing many ._p Files ,manifest file, psm file
|
|
|
|
|
Well, work out what you would do to install them manually and replicate that. It's not rocket science. Think about it.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hello,
For example, I have files with sorted numbers. One way to merge them and save a sorted order is to use a merge sort algorithm. Where a C++ realization of the algorithm (for files, not for memory) can be found ?
|
|
|
|
|
alikalik wrote: Where a C++ realization of the algorithm (for files, not for memory) can be found ?
For instance you may develp it. You are a developer, aren't you?
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]
|
|
|
|
|
you could find it here....
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
Wikipedia[^] has an algorithm for merge-sorting from tape files - that should be sufficient for you to write an implementation.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
alikalik wrote: Where a C++ realization of the algorithm (for files, not for memory) can be found ?
That is good way of asking how can it be done ![Smile | :)](https://codeproject.global.ssl.fastly.net/script/Forums/Images/smiley_smile.gif)
|
|
|
|
|
alikalik wrote: Where a C++ realization of the algorithm (for files, not for memory) can be found ?
How would you do it without a computer? If you had two stacks of paper containing names, how would you go about merging those two stacks together into one?
Now if you are having trouble with accessing arrays and swapping items in them, don't bother with sorting until you get over that hurdle.
"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
|
|
|
|
|
hi i have a project of schedulling for a university through genetic algorithm.
can anyone help me out.
thanx in advance. ![Frown | :(](https://codeproject.global.ssl.fastly.net/script/Forums/Images/smiley_frown.gif)
|
|
|
|
|
Maybe...
Seriously, if you want help ask a precise question. Please, read the posting guidelines ("How to get an answer to your question") for some tips on how to format your question properly.
|
|
|
|
|
|
Have you tried:
void main( void )
{
std::cout << "This is my genetic algorithm scheduling project for university." << endl;
std::cout << "I have learned a lot from it." << endl;
}
"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
|
|
|
|
|
hello,
i have a working vc++ application(few kilobytes) which i want to run as a service. please guide me how to do this ? is there any way to create an installer for it ?
btw thanks
rahul
|
|
|
|
|
|
Madhu Nair wrote: How to: Create Windows Services[^] (C++ Programming)
Sorry Madhu, but i don't think it gives any good light on what the question is
HARSH
Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while the Universe is trying to create bigger and better idiots. So far the Universe is winning.
|
|
|
|
|
Bing for the program "srvany"
--Mike--
Dunder-Mifflin, this is Pam.
|
|
|
|
|
rahuljin wrote: i have a working vc++ application(few kilobytes) which i want to run as a service. please guide me how to do this ?
See here, here, here, here, and here.
"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
|
|
|
|
|
My object is to read the text file containing the name and ages of the students, character by character and then store them in a structure. (For test purpose I want to store just one record) I wrote the following code but it is giving an error "aggregate'main():: record r' has incomplete type and cannot be defined". Why is this?
main()
{
char ch[80],alpha[100],data[80];
int n=0,sno=2;
FILE*fp;
fp = fopen("records.txt","rb");
if(fp == NULL)
{
puts("Cannot open file");
exit(1);
}
struct record;
{
char name[80];
int age;
};struct record r;
while(1)
{
ch[n]=fgetc(fp);
if (isdigit(ch[n])&& ch[n-1]==32)
{r.name[n]=ch[n-1];
n=n+1;
if (n==1)
break;
}
}
fclose(fp);
}
|
|
|
|
|
Razanust wrote: struct record;
{
char name[80];
int age;
};struct record r;
1. Declare the struct outside the main function
2.
struct record; <--
{
char name[80];
int age;
};
Remove the semicolon while declaring the struct.
|
|
|
|
|
Razanust wrote: struct record;
remove the ';' there and see.
--------------------------------------------
Suggestion to the members:
Please prefix your main thread subject with [SOLVED] if it is solved.
thanks.
chandu.
|
|
|
|
|
Wow! Your code has so many problems. For example, how exactly does the while() loop end?
Razanust wrote: My object is to read the text file containing the name and ages of the students, character by character and then store them in a structure.
See here.
You could also use fscanf() like:
fscanf(fp, "%s %d", r.name, &r.age);
"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
|
|
|
|
|
hi
i need an edit ctrl for entering numerical values. sometimes these values must lie in a specified range. otherwise, i want to warn the user by changing the edit-box color.
i derived a class from CEdit for this purpose and tried to put the code in the CtlColor:
HBRUSH MyEdit::CtlColor(CDC* pDC, UINT nCtlColor)
{
if (d_chars==decimalChars)
{
CString s;
GetWindowText(s);
USES_CONVERSION;
int val=atoi(T2A(s));
if (val<d_minVal || val>d_maxVal)
{
pDC->SetTextColor(RED);
pDC->SetBkColor(YELLOW);
}
}
return NULL;
}
i don't need to change the default brush used for painting the ctrl, so i return NULL. but this doesn't work. i tried returning a valid handle to a brush i created, but i could at most change the background color, not the text color.
what's the problem?
what's the best solution?
thx
|
|
|
|