|
Faez Shingeri wrote: I was unable to use any of the above functionality because I didn't have the <wcstr.h> header file in my MinGW.
When using MinGW, use strcpy() and strcat() , or snprintf() . Use PATH_MAX instead of _MAX_PATH . Required include files are stdio.h, stdlib.h, and string.h.
Faez Shingeri wrote: char* dclColEle[10];
This creates an array with 10 elements where each element is a pointer to char. I assume, that this is definitely not what you want.
|
|
|
|
|
|
Your questions are no longer related to the initial topic. I suggest you should create a new topic here in the C/C++ forum or in the Q&A section.
When doing so, much more people will read it and may answer.
|
|
|
|
|
Hello Friends
I am creating an application in which I have to read XML File. That XML file is having different types of nodes and Data stored in it.
I an creating a separate class for each node to read its data and subnodes.
I want a component based structure for class tht I dont need to initialize each node class object everytime.It must be Inherited from one main XML class and all other component class should implement their virtual fn.
Any Structure Idea for this Design.
Thanks In Advance.
Regards
Yogesh
|
|
|
|
|
try factory pattern and it's variant
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Hi,
I have a twofolded question
If I want text on a new line when using Streamin Callback Function for a Rich Edit control I insert a carriage return line feed at the end of the buffer correct ?
and if yes I have the following code which doesn't seem to work
LPBYTE holdptr1, pbBuff;
CString buffer;
strcpy((char *)pbBuff," ");
holdptr1 = pbBuff + 2;
memcpy(holdptr1,buffer.GetBuffer(121),121);
holdptr1 = holdptr1 + 121;
memcpy(holdptr1,"\r\n",2);
*pcb = 125;
|
|
|
|
|
You've declared these pointers, but you haven't allocated any memory for them to point to:
LPBYTE holdptr1, pbBuff;
Another probable error is that you are changing what holdptr1 is pointing to by adding to it:
holdptr1 = holdptr1 + 121;
After seeing this post and some of your previous posts, I can say that you need to study how pointers work. You'll never be able to write code in C/C++ until you fully understand them.
You should find a tutorial or a book that you like, and study it.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
In addition to the other Richard's comments, you should not use fixed value offsets in this way; it will lead to pain and tears very quickly.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Hi,
We issue Software licences on the basis of the Hardware Serial Number and Manufacturers Data stored in the Hard Disk Firmware of the primary disk that our Sotfware is stored on. My Step grandson was interested in learning the operational aspects of the App, so I tried to install it on his notepad. The Licence Aspect Failed, because our Standard Detection Software could not find a Physical Device for Drive 'C:\'
I am not aware of any licensing issues Microsoft had when releasing this version of Windows7 Does anyone know how to obtain similar Machine Identification Data on this type of hardware, that can be used for licencing purposes.
Regards,
Bram van Kampen
|
|
|
|
|
WMI is frequently used for this purpose.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Well,
Those Notepads have No HardDrive, and hence No HardDrive Serial Number, so the Obvious Alternative is the CPU Serial Number.
Richard Andrew x64 wrote: WMI is frequently used for this purpose.
Well, Looked at that. WMI (as far as I can see, gives the Processor Make, Type, etc,etc,etc..., except The CPU Manufacturers Serial Number.
Thanks,
Bram van Kampen
|
|
|
|
|
I have dialog base MFC application
Dialog box contains only one control(radio button)
to change the text color of radio button i use oncltcolor(WM_CTLCOLOR)
BUT it's now working
i am using xp theme
is there any solution
|
|
|
|
|
MKC002 wrote: BUT it's now working
I assume that should read not working, in which case you need to give more detail, including a snippet of your code showing where it is going wrong.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
I have dialog base application, dialog box contains one radio button. to set the text color of radio button
HBRUSH CtestDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
......
// TODO: Change any attributes of the DC here
if (pWnd->GetDlgCtrlID() == IDC_RADIO1)
{
pDC->SetTextColor (RGB(128,0,0)); // blue
}
.....
}
This code works fine and radio button color gets changed
but if i use xp theme in this project then text color of radio button does not set.
To set xp theme, i add one custom resource which contains
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly
xmlns="urn:schemas-microsoft-com:asm.v1"
manifestVersion="1.0">
<assemblyIdentity
processorArchitecture="x86"
version="5.1.0.0"
type="win32"
name="testdlg.exe"/>
<description>testdlg</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
publicKeyToken="6595b64144ccf1df"
language="*"
processorArchitecture="x86"/>
</dependentAssembly>
</dependency>
</assembly>
|
|
|
|
|
I think you may need some extra code in your override, as described here[^].
BTW please use <pre> tags round your code snippets to make them more readable.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
I tried to use given example but the text color for radio button does not set. The background color of radio button is set.
I noticed if i create a dialog box application in visual studio 2008,add one radio button and set its text color in OnCtlColor then the text color does not set.
modified 3-Feb-12 1:38am.
|
|
|
|
|
Unfortunately I do not have an MFC capable version of VS so I cannot test it myself.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Use a sentence, positive and negative output,
For example :
1 -1 2 -2 3 -3 4 -4 5 -5 ...... 1000 -1000
Can use a formal parameters, Can't use loop
Example, pictures address: http://www.hotimg.com/direct/qECUqQ9.jpg
modified 1-Feb-12 11:01am.
|
|
|
|
|
Try rephrasing this... don't understand what you're trying to do. Also, is this your homework? Sounds like it...
|
|
|
|
|
What?
"One man's wage rise is another man's price increase." - Harold Wilson
"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
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
Cary Hill wrote: Use a sentence,...
1. Review the notes from the last three classroom lectures.
2. Read the last chapter of the class text book.
3. Use the method from both of those to solve the problem.
|
|
|
|
|
Bingo!
Sound Advice,
And Recyclable.
You could Add-
corrolary:
if still in the dark, do same for the previous chapters covered in the Class Text Book, An All Course Notes.
If after that you Still do not know how to ask a question, give up coding. You'll Never get there.
Cheers, Some people seem to think that all of us studied under the same curriculum, where given the same projects, so that we recognise their problem in a glance (we all solved the same question 20 years ago fterall), and that we are just petulent, by one of us not just posting our results to them.
I think it very doubtfull, that people who cannot formulate a problem at hand in a meaningful way, will ever become successful in software development.
Regards
Bram van Kampen
|
|
|
|
|
nice advice!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Once I have a long file with ascii text- long row of numbers. I used StrToD() to convert text to array of floating point numbers. I couldn't undrestand, why it works so slowly? Running it under debbugger, I realized what was the problem. This stupid function scanned the whole file, looking for null terminator! I think, there is no reason to scan long text string after set of chars, belonging to the first number has been obtained. Finally I had to write my own realisation of this function.
|
|
|
|
|
strtod (that is the 'standard' C++ strtod , I never heard about StrToD ) is not 'strange': it is a function satisfying its own requirements that are clearly explained, for instance here[^]. If it doesn't fit your needs, then, well, the right way is to write your own one (as you did).
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]
|
|
|
|