|
Check it out - this guy is going to JAIL !!!! I presume his source is the electronic versions that come with a lot of books, but whatever it is, I doubt that Microsoft are giving away titles like 'Programming Windows' and 'Programming Applications for Windows'.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm somewhat suspicious of STL though. My (test,experimental) program worked first time. Whats that all about??!?!
- Jon Hulatt, 22/3/2002
|
|
|
|
|
Please can anyone explain to me with an example how to use the CFtpConnection::Command function. Ive tried it in both VS6 and VS.NET but when it comes to compiling it, both give an error that its not a valid member of the CFTPConnection class even though in MSDN it is listed as being one. I cant seem to find any articles on this either. I know theres the WinInet alternative FTPCommand, but was curious as to why this function doesnt work! ??
The MSDN link is below:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/vclrfCFtpConnectionCommand.asp
|
|
|
|
|
Hi all -
I'm writing a C++ wrapper class around a GPIB instrument control interface. The interface is predominantly controlled by a trio of functions:
viPrintf()
viQueryf()
viScanf()
These functions are fairly similar to Printf, scanf, etc., in that they take a variable number of parameters. viQueryF() takes a pair of const char * -- it effectively does a concurrent viPrintF and viScanF via just one function call.
So here's my problem: how can I expose such functionality in my class? I can write a function that takes a variable number of parameters. I can access those, no problems.
But how can I take the variable length variable list and transform it into a single function call?
I thought up how to handle the viPrintf function -- basically use sprintf in sequence. However, the viScanf(instrument id, const char * str, ...) function requires return addresses of where responses will be stored.
Is there any way I can construct such a function call? ie, pass in all the arguments at once? Or do I have to attempt something astonishingly brilliant that I can't even conceive?
Thanks,
Andrew
|
|
|
|
|
I don't quite get your problem, but if what you want is forward the arguments passed in viPrintf to printf , use vprintf and va_list just like this:
void viPrintf(const char* fmt,...)
{
va_list v;
va_start(v,fmt);
vprintf(fmt,v);
va_end(v);
}
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Well, actually it's more that I want:
void MyWrapper(const char * fmt, ...)
{
va_list v;
va_start(v,fmt);
viPrintf(fmt, v);
va_end(v);
}
I saw mention of some parameterized version of the viPrintf function I'm wrapping that might accept an argument array as above... I suppose I'll have to try.
Is there any other way such magic might be worked?
|
|
|
|
|
OK, now I think I got what you're after. Indeed you can construct the variable argument list at run-time (non-portably) with some hackery along this:
char vargs[10000];
char *pargs=&vargs[0];
int x=5;
*((int *)pargs)=x;
pargs+=sizeof(x);
char *pc;
*((char **)pargs)=pc;
pargs+=sizeof(pc);
printf("%d %s",args); The idea is reserving space in the stack with args and fill this up with the parameters needed. This can be combined with reading the parameters from a va_list in an obvious manner (left as an exercise ).
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
What caused MSOffice open doument file or ACDSee open image files?Is that only extension of file?I need to do something that MSOffice(or other programms) could not open .txt or .doc files but also I shouldn't change the file extension.Any suggestion for doing this?
Mazy
"The path you tread is narrow and the drop is shear and very high,
The ravens all are watching from a vantage point near by,
Apprehension creeping like a choo-train uo your spine,
Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
|
|
|
|
|
As you guessed, it is only file extension that drives the system to select a program to open a particular file. If you want to change the "opening program" of extension .xxx to be program A , do the following:- Open a Windows Explorer and locate a
.xxx file.
- Right click on it while pressing the shift key. Select "Open with..."
- A dialog box appears for selecting the program to open the file with. Select program
A and tick on the checkbox "Use always this program..." (sort of, my OS is in Spanish).
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Thank you Joaquin,but my problem is not that,I wanna do something IN MY PROGRAM,that .doc files become unavaible for Office or ANY OTHER program to open,I don't want to change extension or delete content of files.
Do not tell this to anybody Joaquin,I can say its kind of VIRUS.
Mazy
"The path you tread is narrow and the drop is shear and very high,
The ravens all are watching from a vantage point near by,
Apprehension creeping like a choo-train uo your spine,
Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
|
|
|
|
|
Do not tell this to anybody Joaquin,I can say its kind of VIRUS.
(in low voice) I don't have the slightest idea, but please tell me when you figure it out.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Joaquín M López Muñoz wrote:
(in low voice) I don't have the slightest idea, but please tell me when you figure it out.
Sure
Mazy
"The path you tread is narrow and the drop is shear and very high,
The ravens all are watching from a vantage point near by,
Apprehension creeping like a choo-train uo your spine,
Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
|
|
|
|
|
Mazdak wrote:
I can say its kind of VIRUS
hmm... should I tell ya or shouldn't I...
.
.
.
.
.
.
.
.
.
okay... but I tell only tell ya a little bit!
All these information is stored in the registry!
------------------------------------
Rickard Andersson, Suza Computing
ICQ#: 50302279
I'm from the winter country SWEDEN!
------------------------------------
|
|
|
|
|
Rickard Andersson wrote:
All these information is stored in the registry!
No,Because maybe they have back up from registery or they can reinstall windows.
Mazy
"The path you tread is narrow and the drop is shear and very high,
The ravens all are watching from a vantage point near by,
Apprehension creeping like a choo-train uo your spine,
Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
|
|
|
|
|
I know this has been addressed before in the forums, but i hav nt been able to locate the messages.
Can anyone tell me if I can install VC 7 on a system that contains VC 6 or VC 5, without screwing up the existing development system?
I need to run a trial of VC7, but it won't install on my laptop, so I'm going to have to use one of my production computers <gulp>.
|
|
|
|
|
Jim A. Johnson wrote:
Can anyone tell me if I can install VC 7 on a system that contains VC 6 or VC 5, without screwing up the existing development system?
Yes,it is possible.
Mazy
"The path you tread is narrow and the drop is shear and very high,
The ravens all are watching from a vantage point near by,
Apprehension creeping like a choo-train uo your spine,
Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
|
|
|
|
|
Yep, they work fine together. Need a damn big hard disk though.
Giles
|
|
|
|
|
I've been making a program, and its been executing fine. But all of a sudden, it gave me this error (even though I didn't change anything):
--------------------Configuration: TestGL - Win32 Debug--------------------
Linking...
TestGLView.obj : error LNK2001: unresolved external symbol "public: __thiscall CColour::CColour(class CWnd *)" (??0CColour@@QAE@PAVCWnd@@@Z)
Debug/TestGL.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
TestGL.exe - 2 error(s), 0 warning(s)
I've had these types of errors (which i don't understand) before and usually if I reboot the computer its fine. But this time, its not going away. What does this error mean and how can I fix it? Also, when I double click the error, it doesn't take me to the spot in the file where the error is.
|
|
|
|
|
First thing would be to do a rebuild all.
If that doesn't help then for some reason the CPP file that contains the definition for CColour isn't being included in the link or isn't being defined. See if it has been removed from the project.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
Somehow the linker is not finding the definition for the CColour constructor referred to. Possible reasons:- The definition is actually lacking.
- The definition is in some file that is not being linked (maybe you deleted from the project accidentally).
- Sometimes the precompiled headers feature makes funny thing and a "Rebuild all" drives it back to sanity.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I wanna use CFileFind to find all .doc files in my drive ,including sub directory.The thing I do is with GetFileName() get the string the name of each file and check the last three charachter if it is .doc .Is there any better and faster way for it?
Mazy
"The path you tread is narrow and the drop is shear and very high,
The ravens all are watching from a vantage point near by,
Apprehension creeping like a choo-train uo your spine,
Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
|
|
|
|
|
Look at the example for CFileFind::IsDirectory in MSDN. I believe it contains what you are looking for. Just change the filter that is passed to the FindFile function from
strWildcard += _T("\\*.*");
to
strWildcard += _T("\\*.doc");
Roger Stewart
"I Owe, I Owe, it's off to work I go..."
|
|
|
|
|
No,if I do that that it does not give me sub folders.
Thanks.
Mazy
"The path you tread is narrow and the drop is shear and very high,
The ravens all are watching from a vantage point near by,
Apprehension creeping like a choo-train uo your spine,
Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
|
|
|
|
|
FileFind has an IsDirectory test, from memory. You need to write a recursive function that calls itself on the subdirectories it finds.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm somewhat suspicious of STL though. My (test,experimental) program worked first time. Whats that all about??!?!
- Jon Hulatt, 22/3/2002
|
|
|
|
|
i have 2 classes.
the first class is a crecordview class (Cmain) that holds my data, and is the main dialog for my program.
the second class is a cdialog (Creport), and is opened modal from the crecordview class dialog.
my problem is i have created a class function in the Cmain labeled Cmain::GetData(). this function works fine if i run it from Cmain dialog. I can not find a way to call it from Creport. How can this be done.
If i include the header for Cmain in Creport i get all kinds of errors.
thank you for any help
|
|
|
|
|
Have you included the Cmain header in creport.h or creport.cpp ? If the former, try the latter.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|