|
can anybody tell me how to read hex number in IDX file (foxpro) by using fstream::read ?
|
|
|
|
|
What do you really need to do (hex number is a bit generic, maybe, for instance, a byte , a 16-bit number ... Please note: hex is only a number representation base )?
Maybe you need to:
(1) open the stream in binary mode.
(2) use the method read( unsigned char* puch, int nCount ) to get the relevant bytes.
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.
|
|
|
|
|
Hello,
I have a set of classes in .h and .cpp files.How can I make dll files and .exe files from them
Prithaa
|
|
|
|
|
Where did they come from ? Did you write them ? You need to create dll and exe projects and then put your code into them.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Christian Graus wrote: Where did they come from ?
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
Are you looking for a compiler? Or wanting to know how to change your build settings to get an EXE as opposed to a DLL?
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Hello,
Yes I have made classes through VC++ MFC AppWizard(exe)option in non Doc-View architecture.
Now I want these classes to be used in my another project without actually disturbing the classes.For this purpose if I can make the .dlls and load them in my project directory and #include these .h in my project I think that will be fine.
For now what I do is Add those files in my project through the workspace area and I can actually see all the files in my workspace which I don't want.
Can do like that or I have missed something while making the classes?
Thanks for your replies
Pritaa
|
|
|
|
|
If you've made the classes through the exe AppWizard then it isn't going to be straight forward to try and package them in a Dll. I would suggest starting a new project, An empty Dll that supports/(is linked to) MFC. Then copy the classes you want into it starting with the simplest ones. Then you need to look into exporting the classes from the dll that you want to use. Check this page for a start.
http://msdn2.microsoft.com/en-us/library/3y1sfaz2(VS.71).aspx[^]
I would recommend experimenting a little with creating simple Dlls and using them from simple EXEs before bringing MFC into the picture. Because MFC tries to be a framework it has to assume a 'model' ie EXE or DLL when is generates application classes and the code you get is targetted at one or the other. Things like individual Dialog classes are easy enough to move into a Dll but the main Doc/View classes won't be. Good luck with it anyway
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
|
Hi,
So here's my problem:
I have a child dialog on my main window. I use double-buffering in my application and I'd like the dialog to draw on my back-buffered HDC instead of my front HDC (the HDC of the main window) to prevent flicker when it invalidates.
How can I change the HDC that the child window draws to?
Thanks!
KR
|
|
|
|
|
KellyR wrote: How can I change the HDC that the child window draws to?
Try specifiing the CS_OWNDC style to the child dialog.( using the SetClassLong() function )
|
|
|
|
|
long iv=0;
function InterlockedIncrement(&iv) is used for locking iv according its name, but variable iv is not locked after the function call.
could u explain in which case the iv is locked by the function call?
|
|
|
|
|
|
I explained this to the OP in another post.
While you're correct about locking (probably) not needed on a simple increment,
InterlockedIncrement does more:
SomeCriticalSection.Lock();
iy = (++iv);
returnval = iv;
SomeCriticalSection.Unlock();
return returnval;
Aother thread incrementing iv after the first thread increments it but before the first thread
has copied it could have an undesired effect
Especially on reference counters, which is (probably) most often the reason InterlockedIncrement
and InterlockedDecrement are used.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
The variable is locked DURING the call, not after the call completes.
See here[^].
As Matthew mentioned, what's going on in the call is something like:
LONG InterlockedIncrement(LONG volatile* lpAddend)
{
SomeCriticalSection.Lock();
++(*lpAddend);
LONG returnval = *lpAddend;
SomeCriticalSection.Unlock();
return returnval;
}
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Hi All,
I know this has come up in the context of non-English speaking contributors in an effort to improve article quality. I'm all for it. I submit that the non-English speaking author has a better command of English than I have of his native tongue. So I am humbled by my own ignorance...
However, Subject Matter is a different story. I have a good understanding in some arenas. This knowledge extends sufficiently so that I feel I can provide feedbck and advice. One such area is Cryptography.
I am appaled at some of the articles submitted on Cryptography. In the following, I am not singling out the authors. I am trying to make a succint point.
The latest is TrueCrypt Explorer[^]. This library is using source code and presumably home grown ciphers from the notorius Tom St. Dennis of sci.crypt. Single handedly, he nearly ruined the usenet group with his arrogance and ignorance.
I assume the author is not versed on Cryptography, and as such has fallen victim to TSD's 'Proof by Intimidation' of his cryptosystem. I am not aware of a Cryptanalytic effort by any reputable cryptographer on his work.
Build your own cryptographically safe server/client protocol[^] is misleading because the author states something to the nature he is collecting 'true randomness', which is generally not possible in software.
CTrueRandom - Getting True Random Numbers[^] claims it generates 'True Random Numbers'. I assume the author meant nondeterminsitic method, similar to the noise resisitor placed on the hardware based PRNG board of a RS6000.
As a final example, I point you toward The Art & Science of Storing Passwords[^], where the article claims the practice of storing a password for recover on disk unencrypted is OK.
Jeff
|
|
|
|
|
This is an interesting idea, and I too have felt really aggravated by some of the poor articles posted here. I'm sure you know that historically, the CP editors take care of compliance with formatting, etc., but rarely get involved with content, unless there is a serious concern about plagiarism or something similar. I think that over time, the better articles are recognized and get better ratings.
But SMEs are a whole new thing. I can see how putting content responsibility in the hands of a few anointed SMEs could lead to personality problems just like the one you described. A heavy-handed SME could cause huge damage to the site's collaborative spirit (I'm thinking of another Usenet newsgroup, which is dominated by an obnoxious person who was beaten off when he tried the same stuff here). I think I would rather risk a few bad articles than having to contend with a situation like that.
Why don't you think that submitting (positive) comments on the article forums is the way to go?
|
|
|
|
|
Could the voting system be tweeked so that an article can be voted into oblivion by, for example, 'nill point' votes from 3 separate experts/moderators/SME? This might stop or at least slow down one bad egg from causing trouble but would allow a way to can really bad articles.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Hans
Apologies, I intended to vote your comment 5, but somehow managed to click 1 by mistake - do you know any way to retract a vote?
I didn't particularly want to participate in this debate, but I agree that the submission of positive comments is a good strategy.
Best Regards
Cliff
|
|
|
|
|
Cliff Hatch wrote: do you know any way to retract a vote?
I think you have to send an email to sean@codeproject.com.
Thanks for telling me - now I won't think that Jeff is being mean.
|
|
|
|
|
Cliff Hatch wrote: Apologies, I intended to vote your comment 5, but somehow managed to click 1 by mistake - do you know any way to retract a vote?
Perhaps Chris can help. I would post a questiion on the suggestion board (where this suggestion should have gone - I don't know how I managed to insert it into C++).
Jeff
|
|
|
|
|
Hi Hans,
Hans Dietrich wrote: I can see how putting content responsibility in the hands of a few anointed SMEs could lead to personality problems just like the one you described. A heavy-handed SME could cause huge damage to the site's collaborative spirit (I'm thinking of another Usenet newsgroup, which is dominated by an obnoxious person who was beaten off when he tried the same stuff here). I think I would rather risk a few bad articles than having to contend with a situation like that.
As Gary raised the same issue below, I was not not trying to create censorship.
I was thinking more the way a Book Proofer work: Make suggestions and comment on tecnical correctness. The author can choose to incorporate.
Jeff
|
|
|
|
|
The CodeProject is an informal, open, collaborative site. The approach you describe would convert it to a formal, closed, scholastic one. Demi-gods would 'vet' articles based on their own notion of accuracy, usefulness, and appropriateness.
I think the current approach with the article voting system and each article having its own forum is sufficient.
If you think these articles are poor articles, vote them down. Post a message in their forum stating THIS ARTICLE IS CRAP and explain why. Write a response article.
Software Zen: delete this;
|
|
|
|
|
Hi Gary,
Gary R. Wheeler wrote: The CodeProject is an informal, open, collaborative site. The approach you describe would convert it to a formal, closed, scholastic one. Demi-gods would 'vet' articles based on their own notion of accuracy, usefulness, and appropriateness.
The situation you describe (censorship) is worst than the current. I was not imagining an involuntary system.
Perhaps middle ground is the solution: the Content Editor makes suggestions. If the author chooses, he or she can incorporate the suggestions.
Gary R. Wheeler wrote: If you think these articles are poor articles, vote them down. Post a message in their forum stating THIS ARTICLE IS CRAP and explain why.
I try not to do this (I think it is very unprofessional). Again, I'd rather correct the problem at the source...
Gary R. Wheeler wrote: Write a response article.
In my case, I did: A Survey of Pseudo Random Number Generators[^]. Also, I did try to solicit feedback from two PhD's. Neither would comment. In either case, I tried by going to someone who knows more then me.
Humorously, the beginner article has only garnered a 4/5 rating
Jeff
|
|
|
|
|
I want to get buffers of all streams of a file. I searched msdn then i found ready functions
FindFirstStream and FindNextStream which i ve found in Windows Platform SDK.
These functions give me name of streams. So how can get data in these streams using their name ?
I guess i will use CreateFile and ReadFile again but , what must the parameter given to CreateFile , must it be only stream name or "filenametreamname" ??
Thank you very much...
|
|
|
|