|
D'oh! Yes, you are right! (I definately over-thought this one... ) Thanks alot!
|
|
|
|
|
Ian Bowler wrote: "Untitled - MyApp". I want to get rid of the "Untitled -" so the title bar just reads, "MyApp".
CDocument *doc;
doc.SetTitle("Any title can be given here");
Hope this will do.
<marquee direction="up" height="30" scrolldelay="1" step="1" scrollamount="1" hspace="0" vspace="0">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
I'm at a loss for how to correct for a level 4 warning.
header file
void some_func(some_type *ptr, int flag);
source file
void some_func(some_type *ptr, int flag)
{
...
...
} and when I compile, I get
warning C4100: 'flag' : unreferenced formal parameter and yes 'flag' is an unreferenced parameter, so I make the following change
source file
void some_func(some_type *ptr, int )
{
...
...
} and when I compile, I get
error C2055: expected formal parameter list, not a type list
I'm not sure how I have to change the source file, such that I don't get either the warning or the error. Thanks.
Chris Meech
I am Canadian. [heard in a local bar]
Remember that in Texas, Gun Control is hitting what you aim at. [Richard Stringer]
Nice sig! [Tim Deveaux on Matt Newman's sig with a quote from me]
|
|
|
|
|
You could always do:
void some_func(some_type *ptr, int flag)
{
......
UNREFERENCED_PARAMETER(flag);
}
|
|
|
|
|
Graham Bradshaw wrote: UNREFERENCED_PARAMETER(flag);
I don't use that often enough. Thanks for the quick response, too.
Chris Meech
I am Canadian. [heard in a local bar]
Remember that in Texas, Gun Control is hitting what you aim at. [Richard Stringer]
Nice sig! [Tim Deveaux on Matt Newman's sig with a quote from me]
|
|
|
|
|
#pragma warning( push )
#pragma warning(disable:4100)
void some_func(some_type *ptr, int /* flag */ ){......}
#pragma warning(pop)
or...
Refactor your code so that the unused parameter is not passed to function in first place
|
|
|
|
|
Chris Meech wrote:
... so I make the following change
source file
void some_func(some_type *ptr, int /* flag */ )
{
...
...
}
and when I compile, I get
error C2055: expected formal parameter list, not a type list
Assumption: 'ptr' or even (the real name for) 'some_type' is declared in a header file (from you or from Windows) and confuses the compiler.
|
|
|
|
|
#include "ODBCVER.H"
what is alternation for "ODBCVER.H"of vc6.0 in vc7.0?
can any one please let me know this?
Previously I was using vc6.0;
Now I uninstalled the vc6.0 completely and Installed the vc7.0;
Now I could not run my project. I am getting error as could not open the file "ODBCVER.H".
Please help me.
Nice talking to you.
|
|
|
|
|
I think this file was included in VC6 by accident. It appears to contain data used when building the ODBC library (version information to be included in the file version resource data); I can't imagine what you're using this file for but it should not be necessary.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Hi Mike,
Many thanks for giving the reply. Thanks for your suggestion. Now in my project I simply ignored this include statement. Now my project is working as usual.
Nice talking to you.
|
|
|
|
|
Is it possible to use WinInet FTP and scroll in some window exact communication ? I mean whole ftp commands and responses ?
Thanks!
rrrado
|
|
|
|
|
rrrado wrote: Is it possible to use WinInet FTP and scroll in some window exact communication ? I mean whole ftp commands and responses ?
Better hook winsockX.dll to see actual command coming and going !
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
|
Hi. I'm reading through some *very* old 'C' code that was created during the C89 standards - pre-1999. Basically, I've inherited some code from company A to support at company B.
Anyway, in one procedure I've located a #define that the original programmer quoted as it being local to the procedure.
Now, correct me if I'm wrong (of course you will! ); but, arn't #define's that are created anywhere in the code visible to the remaining portions of the project? That is, all remaining code, across files, that has yet to be compiled (from when the #define is declared) will contain the #define'd parameter until it is undefined?
Was there ever a difference in this behaviour between C89 and C99 conventions?
Thanks!
Carl
-- modified at 10:19 Wednesday 30th November, 2005
|
|
|
|
|
wow, i don't know at all about the old standard, but i never heard of a #define with a local scope...
[edit]
ok, misunderstood. yeah, the module end is limiting the scope of the preprocessor directives, but never a function body !
[/edit]
TOXCCT >>> GEII power [toxcct][VisualCalc]
-- modified at 12:28 Wednesday 30th November, 2005
|
|
|
|
|
|
I am writing a program for a Scoreboard that contains a SplitterWnd, the upper Window (ScoreboardWnd) displays the whole screen with (Period Time, Scores, .. etc). The lower window contains all the Input’s and Buttons to administrate the Scoreboard.
I now want to display only the ScoreboardWnd on another VGA screen (Full mode).
I have looked at the CMonitor class and tested it properly.
On a Laptop with a 2nd VGA out I connected a 2nd TFT screen to see how the program works.
Now a few questions: How can I display out from a SplitterWnd a window on the 2nd screen?
On the laptop the whole program should be displayed.
The program is made with VC 7.xx!
It would be great if you have a sample for such a case I described above. Great work by the way!
Thanks in advance
Best regards
Karl
|
|
|
|
|
Hi all,
I want to run ACDSee from create process
this is the code i use:
STARTUPINFOW si;
PROCESS_INFORMATION pi;
ZeroMemory(&pi,sizeof(PROCESS_INFORMATION));
ZeroMemory(&si,sizeof(STARTUPINFO));
si.cb = sizeof(STARTUPINFOW);
si.wShowWindow = 1;
if(!CreateProcessW(L"C:\\Program Files\\ACD Systems\\ACDSee\\6.0\\ACDSee6.exe",
L"C:\\Program Files\\ACD Systems\\ACDSee\\6.0\\ACDSee6.exe",
NULL,
NULL,
FALSE,
0,
NULL,
NULL,
&si,
&pi))
{
ASSERT(FALSE);
}
ok , the above code seems ok, but the problem is i pass the create process sucessfully, and i can't see any ACDSEE window open (nor i can't see the process in the task manager)....
if i use this substitue code:
ShellExecuteW(NULL,
L"open",
L"C:\\Program Files\\ACD Systems\\ACDSee\\6.0\\ACDSee6.exe",
NULL,
NULL,
SW_SHOWNORMAL);
it is working ok and ACDSEE is opened.
i can't use ShellExecute because i need some process information which PROCESS_INFORMATION structure holds....
can any1 help?
thanks in advanced
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
Not sure if this will work but the second argument of CreateProcess is the commandline parameters that will be sent to the program. So, replace it by NULL and try again.
|
|
|
|
|
doesn't work....
any other suggestion? anyone else?
thanks
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
I'm not sure if this is what the problem is as everything else looks ok, according at MSDN if your using using the si.wShowWindow property you need to set si.dwFlags to STARTF_USESHOWWINDOW else it'll just ignore it.
Out of interest have you tried changing it to launch Word or something to check the code is working ok?
Gavin Taylor
w: http://www.gavspace.com
|
|
|
|
|
also tried it (the STARTF_USESHOWWINDOW ) and still not working...
I tried creating process of notepad.exe and it works 100%!!!
i think the problem is the environment while i create ACDSEE 6 process...because it works fine with ACDSEE 3....not sure why though....
any thought?
thanks again
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
What does GetLastError() tell you?
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
i've managed!
please see my other reply that summarize it all
thank you my friend
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
Two potential reasons:
1) the lpCommandLine parameter of CreateProcessW() is the white-space delimited list of arguments passed as argv to the new process. If ACDSee expects to find the path to its own executable in argv[0] the above would fail, as your path contains whitespaces. Basically the result of the above would be: argv[0]="C:\Program", argv[1]="Files\ACD", argv[2]="Systems\ACDSee\6.0}ACDSee6.exe"
You should quote the string, e.g. pass it as:
L"\"C:\\Program Files\\ACD Systems\\ACDSee\\6.0\\ACDSee6.exe\""
2) The UNICODE-Version of CreateProcess() may fail on NT/2k/XP if the parameter passed as lpCommandLine points to a constant string. This is explicitly mentioned in MSDN. Note that the type is LPWSTR , not LPCWSTR . Maybe you should copy your string to a modifiable buffer and pass this buffer to CreateProcessW() :
I usually pass NULL for the lpApplication parameter and only use lpCommandLine . Of course, you have to make sure that a path containing white-spaces is quoted in this case (as described above). ShellExecute() is intended to be more "user friendly", that is it applies some heuristics to resolve pathes containing white spaces and does other "magic stuff".
Hope that helps
--
Daniel Lohmann
http://www.losoft.de
(Hey, this page is worth looking! You can find some free and handy NT tools there )
|
|
|
|