|
good then I do not spend my time as unregistered anymore.
|
|
|
|
|
Glad to hear it.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
I will not answer to this....
but only because I like to keep away flamebates from this forum and appreciate a friendly surrounding.
|
|
|
|
|
Anonymous wrote:
but only because I like to keep away flamebates from this forum and appreciate a friendly surrounding.
What is your problem ? You said you were not going to post anonymously anymore ( I presume now you were being sarcastic ), and I took it in good faith and said I thought it was a good thing that you create an account and put your name to your opinions. Actually, all I said, with those things in mind, was 'glad to hear it'. The possibility that you were being rude and sarcastic crossed my mind, but I gave you the benefit of the doubt, made an encouraging comment, and now I am trying to bait you ?
Every time I try to be nice to anonymous posters, I am left with a stronger opinion that anonymous posts should be banned and a valid email address required to create an account. I'd also bar hotmail et al. I think people would be less arrogant if they knew that when they said something, people who read it would be able to reply, and would know who they were.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Hi
i need to write programs using viusal c++ but i do not know the commands to use.
When i read the explainations from the MSDN library the terms used are very technical.
i need to know
1)how to read texts from the .ini file,
2)create directories
3)compare files
4)move files and store them to specific directories.
5)check time
Where can i find a simple book or web site that explains in simple terms.
Thks
|
|
|
|
|
needhelp ;(( wrote:
i need to write programs using viusal c++ but i do not know the commands to use.
When you say need, why ? Is it for school ? Do you have a one off project you need to complete for some other reason ?
needhelp ;(( wrote:
When i read the explainations from the MSDN library the terms used are very technical.
Yeah, that's called C++. Actually, a lot of the MSDN examples are in C, so they can be used by all Windows programmers, even those living in the dark ages.
needhelp ;(( wrote:
Where can i find a simple book or web site that explains in simple terms.
My first book was 'teach yourself C++ in 24 hours'. If you're looking to connect the numbers to get a simple windows app going and not really learn how to program ( and that's fair enough if you don't intend on coding again ), then 'teach yourself visual c++ in 24 hours' is a good starting point.
What's your reason for needing to do this, obviously without any background or experience ? What time frame do you have ? There are websites where you can pay people to write a one off project for you, that may be an option also, depending on your circumstances. If however you want/need to learn it yourself, those books are a good start, and you can always ask specific questions here when you get stuck. That's what I did.
Good luck.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Hi,
Thks for replying.
It was for my school project. I wrote some of the commands on visual c using c langauage it has many errors.
Besides, i brought many book like 'teach yourself in 21 days' What was taught inside the book are not what i need to know.what i need to know are not taught.
i went throught a lot of books but none areuseful to me.
|
|
|
|
|
needhelp ;(( wrote:
It was for my school project. I wrote some of the commands on visual c using c langauage it has many errors.
Does this mean the rest of the class is doing the same thing, or that you're all doing whatever you like within certain parameters ? If it's for a school project, I can't help think that the class should have taught you everything you need to know to do it.
needhelp ;(( wrote:
Besides, i brought many book like 'teach yourself in 21 days' What was taught inside the book are not what i need to know.what i need to know are not taught.
In the world of computers, new languages and API's are always coming out. What is needed is not knowledge of this or that, but of how to learn. The teach yourself C++ books would teach you the C++ language, which ideally you should learn first. The 'visual C++' books teach how to write a windows program with MFC, how to intercept messages and so on. If you completed both of these books, you'd have no trouble reading the MSDN documentation.
needhelp ;(( wrote:
i went throught a lot of books but none areuseful to me.
You're asking for some reasonably basic things, which are discussed in MSDN, with example code and full explanation of syntax. It seems to me that you're way out of your depth here. If you're doing a set assignment, you should probably go and see your teacher and ask for some advice on how to revise the classes you missed or did not understand. If you're setting your own task, you should probably rethink it unless you have a fair while to finish it in. Any explanation I give of the things you want to do would either be as confusing for you as MSDN is, or they would simply do your work for you, which is of no value to anyone.
If you have no choice, I recommend revisiting the books you have bought, learn some C++, read the MSDN and ask questions if you get stuck on specific problems. There was a recent article on moving a directory and it's contents in code, I suspect it would explain and call a lot of the API's that do the sort of stuff you want. I've also written a number of articles on the iostreams library, ifstream is the class you want to look up for reading files off disk, and ofstream for writing them again.
Good luck.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Hello,
I am trying to create a three-way splitter window (two rows, with the upper one vertically split into two columns). I have the problem that, although they are created properly, and I can initialise them with data, when the app starts, the horizontal splitter begins by being right up against the top of the window, so that I have to pull it down before I can see the data. The vertical splitter is fine.
My code is as follows:
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT /*lpcs*/, CCreateContext*
pContext)
{
// TODO: Add your specialized code here and/or call the base class
CRect rect;
GetClientRect( &rect );
CSize size = rect.Size();
size.cx /= 2; // Initial column size
size.cy /= 2; // Initial row size
// 1 - Create first static splitter
if( !m_wndSplitter1.CreateStatic( this, 2, 1 ) ) // 2 rows, 1 col
{
TRACE0( "Failed to create first static splitter\n" );
return FALSE;
}
// 3 - Create nested static splitter
if( !m_wndSplitter2.CreateStatic( &m_wndSplitter1, 1, 2, // 1 row, 2 cols
WS_CHILD | WS_VISIBLE,
m_wndSplitter1.IdFromRowCol( 0, 0 ) ) )
{
TRACE0( "Failed to create nested static splitter\n" );
return FALSE;
}
// 4 - Create top-left view
if( !m_wndSplitter2.CreateView( 0, 0, // row 0, col 0
RUNTIME_CLASS( CLPSTreeView),
size, pContext ) )
{
TRACE0( "Failed to create top-left view\n" );
return FALSE;
}
// 5 - Create top-right view
if( !m_wndSplitter2.CreateView( 0, 1, // row 0, col 1
RUNTIME_CLASS( CLPSListView ),
size, pContext ) )
{
TRACE0( "Failed to create top-right view\n" );
return FALSE;
}
// 2 - Create bottom row view
if( !m_wndSplitter1.CreateView( 1, 0, // row 0, col 0
RUNTIME_CLASS( CLPSEditView ),
size, pContext ) )
{
TRACE0( "Failed to create bottom view\n" );
return FALSE;
}
return TRUE;
//return CFrameWnd::OnCreateClient(lpcs, pContext);
}
Theoretically, the horizontal splitter should start by being halfway down the window, shouldn't it?? I would be grateful for any help.
Thanks,
Paul Trimming
|
|
|
|
|
hi,
How can i delete files locked by windows ?
I want to delete the 'index.dat' file in the folder '\windows\temporary internet files\content.ie5' folder programmatically.
thanks
Hari Krishnan
|
|
|
|
|
I *think* the API to unlock a file is called 'SetFileAttributes', but I doubt that will work here. If the system has the file open, there isn't anything you can do about it.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
I need a folder / file search dialog - I am aware of CFileDialog, but this won't return folder paths, only file paths. Is there any other class which will give me this combined function ? (The folder search is often used in installation programs, so I guess something standard must exist)
Doug
|
|
|
|
|
Guys,
I've developed an application in VC++. It is a simple application, a sort of a dictionary. It searches the meaning of a word typed by a user from a text file. Ofcourse i distribute the text file with this application, otherwise it'll be of no use
I've provided the internet update facility in the application i.e the user of application can run an upgrade program that checks the new enteries in the dictionary on the internet, and download the new words added. This should be noted that the entire text file is not downloaded again. Only the new words added are downloaded and then they are just appended in the existing text file.
The text is arranged in text file with some syntax, so that my application program correctly recognizes words and their meanings.
Here is the problem, if a user of my application manually open and edit the file and disturb its syntax, then ofcourse program will not work. So, i do not want to distribute a plain text file to user. Instead i want to provide user a dll, in which this data must be present.
As such is it possible for me to append dll data as what i am doing in case of text file?? If yes, than how do i make such dll and how i represent data in that dll whether char array or what??? Is there any other alternative solution you suggest for my problem ????
|
|
|
|
|
Shamoon wrote:
Here is the problem, if a user of my application manually open and edit the file and disturb its syntax, then ofcourse program will not work. So, i do not want to distribute a plain text file to user. Instead i want to provide user a dll, in which this data must be present.
In my ipnion,I think the easiest solution is to rename your ***.txt as ***.dll.I mean,user may think the file is a dll file,but it is a text file actually.
Shamoon wrote:
As such is it possible for me to append dll data as what i am doing in case of text file?? If yes, than how do i make such dll and how i represent data in that dll whether char array or what??? Is there any other alternative solution you suggest for my problem ????
My answer is that you can program to change the True Dll file resource to complete your thoughts.
But I strongly suggest you to use my solution,I had use it in many many many project.It's my top secret )
I am I,Who is who,I am who,Who am I
|
|
|
|
|
Hi
I have been looking for a sample code for global hooks. Those I have seen seem to all be called from a MFC application and not a standard C++ using API. I thought I had it down at one stage but the dll I wrote only seemed to catch calls to itself and the calling process. Any help would be appreciated.
|
|
|
|
|
I would like my MDI application to always display open files with "courier" font.
I assume i need to change the font in Appview::OnCreate.
I am having trouble understanding how to do this. Could someone point me in the right direction?
Thanks
Kevin
|
|
|
|
|
I figured it out
|
|
|
|
|
I have never had to fully support UNICODE in my code before but I am making an effort to insure that all future code I write will work with it anyway.
I think I understand TCHAR, LPCTSTR, LPTSTR and all the _tcsxxx functions. BUT, I have a questions which I haven't been able to find an adequate answer to.
Many functions and classes use sizes in BYTEs when working with data. Examples include memcmp, memcpy, the _open, _write, _read file support functions, etc.
What is the correct way of working with these functions and UNICODE strings. My first thought is to write a macro or inline function like this:
#define _tcsbytelen(text) (_tcslen(text)*sizeof(TCHAR))
and use this whenever working with functions where BYTE length is needed. Is there a more correct way of doing this that I have overlooked?
Thanks,
Matt Gullett
PS. MFC is not an option and whatever solution I find must work with or without STL too.
|
|
|
|
|
Matt Gullett wrote:
_tcslen(text)*sizeof(TCHAR)
That is correct in some cases, such as writing the string to a file. However if you are copying the whole string including the null terminator (such as with memcpy) you need to add 1 to the length:
(1 + _tcslen(text))*sizeof(TCHAR)
--Mike--
Thing #9 to say when mad at work: "Therapy is expensive. Popping bubble plastic is cheap. You choose."
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Thanks for the response. (Love your articles)
Is 1 enough in these situations or should I really be using sizeof(TCHAR)?
Is the NULL terminator for UNICODE strings just 1 byte? Surely not?
|
|
|
|
|
Matt Gullett wrote:
(Love your articles)
Thanks
Matt Gullett wrote:
Is 1 enough in these situations or should I really be using sizeof(TCHAR)?
What you have is right. In the code I gave earlier, you aren't adding 1, you're adding 1*sizeof(TCHAR) , which is 2 in Unicode builds. The terminating zero in a Unicode string is 2 bytes, the same size as the other characters.
So if you have the Unicode string L"Bob" , the byte length is (1+_tcslen(L"Bob"))*sizeof(TCHAR) => (1+3)*2 => 8
--Mike--
Thing #9 to say when mad at work: "Therapy is expensive. Popping bubble plastic is cheap. You choose."
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
to use unicode string, u should forget words "NULL terminator".
there is no such terminator in a general unicode string.
includeh10
|
|
|
|
|
Hi all,
I have a very trivial question regarding float format.
I have the following two statements.
int a = 3.145;
printf ("%f\n", a);
As a result of printf I get 0.0000 why?
I was expecting 3.0000
Any help in this regards
best regards
/rsasalm
|
|
|
|
|
because if you tell printf that you are giving it a double (%f) then you have to give it a double. it can't perform the cast from int to double for you, because the "..." argument list mechanism that printf uses is not type-safe or even type-aware.
try printf("%f\n", (double)a);
-c
There's one easy way to prove the effectiveness of 'letting the market decide' when it comes to environmental protection. It's spelt 'S-U-V'.
--Holgate, from Plastic
|
|
|
|
|
There is no type-checking done on the extra printf() parameters. If you have %f in the format string, it's up to you to actually pass a float variable there. Since you are passing an int , all bets are off.
--Mike--
Thing #9 to say when mad at work: "Therapy is expensive. Popping bubble plastic is cheap. You choose."
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|