|
Pogo Lin wrote: I think system has enough memory...
But is there a contiguous 256MB chunk?
"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
|
|
|
|
|
I don't know. Could you tell me how to check that system has a contiguous 256MB chunk?
Thanks a lot.
|
|
|
|
|
I have a little problem for using SaveAs in outlook
Can someone tell me how to assign the parameter for olVCard ?
It is a variant, but I always fail. I don't know why.
Outlook::_ContactItemPtr pContact = NULL;
lpDispatch->QueryInterface(IID__ContactItem, (void**)&pContact);
if(pContact)
{
_variant_t VAR = vtMissing;
VAR.intVal = OlSaveAsType::olVCard;
HRESULT hr = pContact->SaveAs(L"c:\\11.vcf",VAR);
assert(SUCCEEDED(hr));
}
Reference:
http://www.microsoft.com/technet/scriptcenter/resources/qanda/jul07/hey0724.mspx
On Error Resume Next
Const olFolderContacts = 10
Const olVCard = 6
Set objOutlook = CreateObject("Outlook.Application")
Set objNamespace = objOutlook.GetNamespace("MAPI")
Set colContacts = objNamespace.GetDefaultFolder(olFolderContacts).Items
For Each objContact In colContacts
strName = objContact.FirstName & objContact.LastName
strPath = "C:\Test\" & strName & ".vcf"
objContact.SaveAs strpath, olVCard
Next
|
|
|
|
|
faulfish wrote: ...but I always fail.
What is this supposed to mean?
"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
|
|
|
|
|
Hi all!
i need help.. i m calling fileRead function which reads the file and put some values in three strings cName1 ,cSvnPath1 ,cPassword1...now my question is ...that how should i call this function in main file so that these three strings can be utilised in main file only...??? please answer as early as possible.
void FileOperation::fileRead(char cName[100] , char cSvnPath[100] , char cPass[100])
{
char cName1[100];
char cSvnPath1[100];
char cPassword1[100];
FILE *fp;
fp = fopen("config.txt","r");
fgets(cName1 , 100, fp);
fgets(cSvnPath1 ,100 , fp);
fgets(cPassword1 ,1 ,fp);
fclose(fp);
}
|
|
|
|
|
1) i don't understand your question
2) i don't understand your code either
3) no need to say "i need help" (if you ask something, it's obviously because you need help), nor "please answer as early as possible" (people do reply when then know the answer... if no one reply you, it's because no one knows, or no one got your question).
so, i ask you the question. What is it you're trying to achieve, and what have you already tried ?
what do you mean by "these three strings can be utilised in main file only" ??
|
|
|
|
|
I simply mean that i m calling fileRead() in main()..i have other three strings ...a[] ,b[],c[]...now i want that data from cName1 ,cSvnPath1 and cPassword1 should get passed in main to Strings a, b, c respectively..i hope u'll get it now..So, how can it be done..i m getting problem in initialising...thanks.
|
|
|
|
|
toxcct wrote: if you ask something, it's obviously because you need help
Simple, yet powerful.
"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
|
|
|
|
|
My comments to your code:
Why do you get 3 char-arrays as parameters, but never use them?
Instead you are putting your read data into local variables (which will get destroyed upon leaving the function).
You definitely want more error checking when opening the file and reading the data.
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
these mistakes r becoz i was trying something to get solution but i did nt get..i want these local variables to be passed to main function
|
|
|
|
|
dona jain wrote: i want these local variables to be passed to main function
Why?
Wouldn't it be better to pass the buffers from Main to your function?
Local variables get destroyed on leaving their scope.
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
well this is my requirement to do so..thats y i m here
|
|
|
|
|
Ranjoy Guha already programmed you a function which you simply need to give the buffers as parameters:
char buffer1[100];
char buffer2[100];
char buffer3[100];
FileOpration fcRead;
fcRead.fileRead( buffer1, buffer2, buffer3); Now look at buffer1, 2, 3 in the debugger.
As a side-question:
Do you really desire to learn C?
And why do you ask your questions in a C++/MFC-Forum?
The C++ way of reading a file would be std::ifstream .
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
jhwurmbach wrote: And why do you ask your questions in a C++/MFC-Forum?
man, don't be rude on this... there's no C board, and most C++ programmer can understand a C problem.
but the problem of the OP is that he doesn't know anything (maybe VB...) but he doesn't want to learn either
|
|
|
|
|
void FileOperation::fileRead(char cName[100] , char cSvnPath[100] , char cPass[100])
{
//char cName1[100];
//char cSvnPath1[100];
//char cPassword1[100];
FILE *fp;
fp = fopen("config.txt","r");
fgets(cName , 100, fp);
fgets(cSvnPath ,100 , fp);
fgets(cPass ,100 ,fp);
fclose(fp);
}
Now use the arguments in your main file
|
|
|
|
|
ohh..thanx...can u tell me how to call this function in main
FileOpration fcRead;
fcRead.fileRead();
this or something else??
fileRead() --> is this correct?
|
|
|
|
|
You just pass the arguments you want to your function. Calling a function and passing parameters is basics C++ so I really suggest you read some book before going on with classes otherwise you'll get totally lost.
|
|
|
|
|
dona jain wrote: can u tell me how to call this function in main
oh my god !!!
you know what ?
stop this immediately, go to a book shop, find Kernigan & Ritchie's Book about the C language, and read (i mean, read and LEARN) !!!
then you'll find all this becoming very easy
|
|
|
|
|
char cName[100];
char cSvnPath[100];
char cPass[100];
fileRead(cName, cSvnPath, cPass);
|
|
|
|
|
Hey..its working now...u r realy a nice person here ..others always uggest book..never answer me properly.
Thank A lot
|
|
|
|
|
I think Mr Ranjoy Guha is not the inventor of C++ .Without reading those books even he could not have answered ur problem:
never say die
|
|
|
|
|
hey, it's not to annoy you if we suggest you to read books... it's for your own efficiency dude !
it's as if you drive a car without a license... how can you drive on a highway then if you don't learn driving first ?
oh and By the way, if we "never answered properly" as you say, it's because you never ask properly !
and at last, "u", "y" and "r" are letters; "you", "why" and "are" are the words to use if you want anybody to understand you. you're not an a chat room, and people around here are from all over the world. be compliant with the policies, and everything will be fine. if you don't want to comply, i'll stick on your ass to warn you as you already started to know me for this
|
|
|
|
|
well i knew this very well that without reading books..i can't...but if its some sort of urgency.. you hav to take someone's help ...is that wrong?...please forget all those past mistakes...and lets be friends.;)
|
|
|
|
|
are you an indian?? Me too from India...its seems from your name...JAI HIND
|
|
|
|
|
dona jain wrote: well i knew this very well that without reading books
well, don't get me wrong.
i'm not paid to answer on this board. all i do is because i want to and i love it.
but i'm still thinking you have some lack of knowledge that you should fix fastly. calling a finction is part of the basics of the C/C++ (and any programming - in general...) languages. if you can't figure out how to call one, then you should start from the beginning.
dona jain wrote: but if its some sort of urgency
i'm not a doctor
dona jain wrote: you hav to take someone's help
i'm not obliged to do so, and know that i do my best anyway. but sometimes, i really don't understand the question, so how to help then ?
and if i was obliged to help, then the one who's asking should be obliged to ask with all the useful informations we must have to answer well in a one step. Is that Wrong ?
dona jain wrote: please forget all those past mistakes
i hope you understood me and will make efforts in the future. for my part, i have nothing against you. just against your questions
Sincerely...
|
|
|
|