|
yeah, that was a joke, saying that C99 kools like a compiler error number...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
C99 is adopted by ANSI at 2000
VC6 is released at 1998
My blogs:
http://blog.joycode.com/jiangsheng
http://blog.csdn.net/jiangsheng
http://bloglines.com/public/jiangsheng
Command what is yours
Conquer what is not
---Kane
|
|
|
|
|
i know that
but i also see that you definitely have no humour...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
machnotrix wrote: Does VC6 support C99 standard?
No. The C99 standard was finalized after VC6's release.
There's a chat transcript[^] on MSDN that briefly discusses C99 support in Microsoft's products.
Software Zen: delete this;
|
|
|
|
|
Can anyone see a problem with this code? It keeps resetting the original string line so it jumps out of the loop after the first token. What it should do is parse the whole line...
For some reason it doesn't seem to like the "\\" delimiter, if I use " " is works fine - but " " is not the delimiter I need.
Thanks for any help in advance
<br />
char * token;<br />
char dir_name_out[256];<br />
<br />
char *delims = "\\";<br />
<br />
strcpy(dir_name_out, "");
<br />
token = strtok(dir_name_in, delims);<br />
<br />
while(token != NULL)<br />
{<br />
if(strlen(token) > 8)<br />
{<br />
token[6] = '~';<br />
token[7] = '1';<br />
token[8] = '\0';<br />
}<br />
<br />
strcat(token, "\\");<br />
<br />
strcat(dir_name_out, token);<br />
<br />
token = strtok(NULL, delims);<br />
}<br />
u6ik
|
|
|
|
|
If you are just searching a path for its components, why not use _splitpath() or one of the various Pathxxx() functions from the Shell API? Much better than trying to do it yourself. Also, to create a short filename from a long one, just use GetShortPathName() .
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
Cheers Dave. Problem solved.
Although.. the original problem is a poser. Still, no time to mess around when you're on a deadline
Thanks again.
u6ik
|
|
|
|
|
u6ik wrote: Although.. the original problem is a poser.
What is the initial value of dir_name_in ?
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
First, here's your code with the indentation restored (note: use the <pre>...</pre> tag when posting more than one line of code):
char * token;
char dir_name_out[256];
char *delims = "\\";
strcpy(dir_name_out, "");
token = strtok(dir_name_in, delims);
while(token != NULL)
{
if(strlen(token) > 8)
{
token[6] = '~';
token[7] = '1';
token[8] = '\0';
}
strcat(token, "\\");
strcat(dir_name_out, token);
token = strtok(NULL, delims);
} A couple of things about strtok . One, it modifies the original string, but nothing in your logic has an issue with that. Two, it returns a pointer within the original string. For this reason, operating on the token value is A Bad Idea. The line strcat(token,"\\"); could overwrite the '\0' delimiter placed by the preceding call to strtok . You would be better off copying the token out to a separate local string, and operating on that.
Software Zen: delete this;
|
|
|
|
|
Thanks Gary. I've made the suggested corrections and all works fine now.
token = strtok(dir_name_in, delims);
strcpy(buf, token);
while(token != NULL)
{
if(strlen(buf) > 8)
{
buf[6] = '~';
buf[7] = '1';
buf[8] = '\0';
}
strcat(buf, "\\");
strcat(dir_name_out, buf);
token = strtok(NULL, delims);
}
By copying the token into buf and manipulating that, it doesn't effect the operation of the strtok function.
Thanks again
u6ik
|
|
|
|
|
Hi there, I have build a small printer driver prototype for win2003 x86 and I am trying to install the driver via the add printer wizard but it is not installing and I am recieving a "Printer driver was not installed. Operation could not be completed" (not much info ).
Now I am trying to attach windbg to the spool process to see what is happening but windbg is not loading the symbol files and not recieving any of my debugging messages from the driver.
I am stump, is there any body out there that can help me; what functions are loaded first by the spooler when installing and what could be the causes of such malfunction.
Thanks in advance
Neoadam
|
|
|
|
|
Are you attaching to a second machine via serial port?
Do you have the path to your source code listed in WinDbg?
Top ten member of C++ Expert Exchange.
http://www.experts-exchange.com/Cplusplus
|
|
|
|
|
No the driver is in user mode so I´m debugging on a single machine, and yes Ihave the path to my source code and debugging symbols in the windbg . So I´m really not usnderstanding why it is not breaking and why it is not recieving the debugging messages from the driver?!
|
|
|
|
|
In my application..i had created the edit boxes dynamically in a class called "Ctrls".The styles are defined in this class..Now my aim is to get these styles to my another class called "Implmn".In this class i am using PreTranslateMessage()..
if(pMsg->message == WM_KEYUP && pMsg->wParam == VK_END)<br />
{<br />
{<br />
<br />
return TRUE;<br />
}<br />
}
How exactly i have to write the code so as to get working the Bold lines..I have to get the style from that class("Ctrls" to "Implmn")..
Plz Help ME!!Thanks in Advance..
|
|
|
|
|
I think you missed completemy the principle of object oriented programming and classes. I suggest you buy a good book or find a good tutorial (sorry, don't have any link) that will explain you what a class is and how to use it.
I don't want to sound offensive but I think you lack quite a lot of necessary informations about that subject and it is something too large to explain here.
|
|
|
|
|
hey...
my drawing applications plots a graph for input received after 1 second....the drawing area(picture box treated as a bitmap)needs to be refreshed so that graphs appers moving...
i am using Invalidate() to refresh...plotting is fine but the drawing area flickers...
how to get rid of it?
thanks
|
|
|
|
|
The standard solution to this problem is to use "Double Buffering". There are heaps of articles on the subject.
Kakan
|
|
|
|
|
Try using double buffering by drawing directly into memory.
After you finish drawing into memory you can transfer the contents of memdc back to your drawing area.
For this you will have to follow the following steps:
Just a sample...
CDC dc;
dc.Attach(this->GetDC()->m_hDC);
CDC memDC;
memDC.CreateCompatibleDC(&dc);
CBitmap memBmp;
memBmp.CreateCompatibleBitmap(&dc, 100, 100);
CBitmap *oldBmp = memDC.SelectObject(&memBmp);
dc.BitBlt(0, 0, 100, 100, &memDC, 0, 0, SRCCOPY);
memDC.SelectObject(oldBmp);
dc.Detach();
This is just a sample of double buffering. This will prevent flickering.
Happy programming
<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 use 'IShellFolder2'
It's Ok before declaration
but using member function then complie error C2027
what's the problem?
I don't know.
and It's All Ok from downloaded sources include 'IShellFolder2'
but It's not Ok my source what typing myself.
please help me.
and so sorry about my little English.
Thanks.
|
|
|
|
|
redefine _WIN32_WINNT, WINVER, _WIN32_IE to target win2k or later
My blogs:
http://blog.joycode.com/jiangsheng
http://blog.csdn.net/jiangsheng
http://bloglines.com/public/jiangsheng
Command what is yours
Conquer what is not
---Kane
|
|
|
|
|
hi ,
i used GDI+ in my application in VC++ 6.0.
i include the GDI+ files in directory,
and i added the both lib & dll files to my application
but it through the ERROR as
E:\12\mahadlg\mahadlgDlg.cpp(75) : error C2065: 'Image' : undeclared identifier
E:\12\mahadlg\mahadlgDlg.cpp(75) : error C2146: syntax error : missing ';' before identifier 'image'
E:\12\mahadlg\mahadlgDlg.cpp(75) : error C2065: 'image' : undeclared identifier
E:\12\mahadlg\mahadlgDlg.cpp(75) : error C2061: syntax error : identifier 'Image'
E:\12\mahadlg\mahadlgDlg.cpp(76) : error C2065: 'Graphics' : undeclared identifier
E:\12\mahadlg\mahadlgDlg.cpp(76) : error C2146: syntax error : missing ';' before identifier 'graphics'
E:\12\mahadlg\mahadlgDlg.cpp(76) : error C2065: 'graphics' : undeclared identifier
E:\12\mahadlg\mahadlgDlg.cpp(76) : error C2061: syntax error : identifier 'Graphics'
E:\12\mahadlg\mahadlgDlg.cpp(78) : error C2143: syntax error : missing ';' before '}'
send reply
|
|
|
|
|
Hello.
Include the GDI+ headers in your source file mahadlgDlg.cpp
(AFTER #include <stdafx.h>)
I.e:
using namespace Gdiplus;
#include "GdiPlusBitmap.h"
#include "GdiPlusHeaders.h"
And
#pragma comment(lib, "gdiplus.lib")
That should do the trick.
Kakan
|
|
|
|
|
maharaja pandian wrote: Is it possible to use GDI+ in VC++ 6.0
yes!, why not
maharaja pandian wrote: but it through the ERROR as
Since above class are defined under namespace Gdiplus, so you have to make call for
using namespace Gdiplus
"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, there
Can anyone teach me how to make the digital clock 'bigger' as in the number size ? I tried the whole day still failed. pls help.
C++ noob
Many thanks in advanced.
|
|
|
|
|
and why don't you ask its author on the forum ot the bottom on the article[^] ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|