|
OK, I seem to have contracted the most severe case of nubyism in my attempt to finnally learn to program windows.
About a month ago I bought myself VC++.Net thinking i could whip up a quick and simple interface for my Robot. I've been at it since then and still have no clue. I've done tute after tute, though most are for VC++6 and don't seem to translate well to .NET. I've borrowed the only windows programming book in the Uni library "Beginnning Visual C++ 6" and while all this is good and has taught me alot, I still seem to be missing some fundamental concetuality.
I've been able to program C++ for years so this is not the problem. But to explain my problem I'll walk through and example.
I've used the App wizard to generate a Dialog Based MFC App.
I drop a scroll bar on the Dialog
I look to add a new event and bang! I hit a brick wall- repeatedly
what the hell is with NM_THEMECHANGED????? It's the only event i can get.
How do i do anything at all with my scrollbar????
Ragman
|
|
|
|
|
I highly recommend Programming Windows With MFC by Jeff Prosise.
Kuphryn
|
|
|
|
|
Yeah, it's certainly on my wishlist but seems to be out of print and secondhand ones run upto twice the origional new price. There are some second hand ones at Amazon but when i tried to order one found out they wouldn't ship out of the US.
A prefered book is "Programming with Microsoft Visual C++.NET, Sith Edition" though it is even more elusive which suprises me as it's far more recent.
Darryl
|
|
|
|
|
Programming in general is not an easy think.
You can not just put a program with so many buttons and options and exept to programming by it self.
You don't only need one borow book, but all the books on the market.
You also need MSDN, and SDK, and many simple examples.
You also need time and a good teacher
And you must be young have the time and the wish to learn
From the other hand maybe you don't really need to make any big program, but even in this case you still need some one to teach you some thinks.
Programming is not like eg photoshop, that even if you don't know it you can open a file, make a blur save it, and say that somthing you do.
>simple interface for my Robot
Ask some one to teach you the basic and work with you for that interface, and then you see if you can handle to do somthing simple and continue it.
Vini
|
|
|
|
|
Actully... VC++ is real programming.. if anybody understand..then s/he will get into into it..if not then forget to use VC++.. VC++ demand real skill of patience..
if you have that..then try & try again.. as you try you will learn something new...
better use VC++6 first.. follow any book.. main thing need is hard-word..to learn...not as in VB.
slowly slowly you feel that you r getting in depth of vc++.. but that can't happen in one day or one month..it'll take time.. min. 3-4 month to get in vc++.. so try..
Best of Luck...
Bye...;)
---Sumit Kapoor---
|
|
|
|
|
Thanx for the encouragement. It's nice to know that i'm not the only one that had to bash my head for so long. the time estimate realy helped..one month down 3 to go.
However there seems to be something unique about the ScrollBar control in that it has no Event handlers to add where the other controls have a whole mess of them with I can use quite easily.
I'll put that question in a new thread though.
Thanx
Darryl
|
|
|
|
|
hi..I think you may be start working in MFC of vc++.. that's easy to use(as this wrapper to actual windows programming).. One my suggeation is to spend just 10 days with windows programming..Go to library & take a thin book on windows programming...then you u'll get idea How all thinges are working in windows..
In small term it is not matter of know/not know about windows programming concepts.. but if you realy want to see this programming as long term then just overview of that is must.
Rest fine..e-mail me anytime if you need any help..I'm not expert, so may not answer all of your Questions..but I'll try if I get time(Time is busy going on...)
OK! Bye..Best of Luck..keep working..Goal is near..
sumit_kapoor1980@hotmail.com
---Sumit Kapoor---
|
|
|
|
|
Hi Sumit,
I've got a toe hold on it now and think the worst of it is over as far as conceptualisation goes. I managed to write the user side of the interface i wanted once i was told how to use scrollbars properly. Still peeved that they don't have any event handlers as i need up to 12 scroll bars on the one dialog and then have to hack into their control ID's from Wnd::HScroll and then work out which one i've got. Be much nicer if they just had a dedicated OnScroll handler.
Anyway, my stress levels from the last month have just dispated into the ethers ready to snag then next person attempting to learn Windows programming
Darryl
|
|
|
|
|
Hi,
I want to extract a frame from an Motion JPEG avi file. Can anyone help me. Is there any link which gives me an info on the file format for the video data in the avi. I'm able to extract the header from the avi file in BITMAPINFOHEADER struct, and then read the avi property. How are the video frames stored? is it as JPGs or BMPs in Motion Jpeg Avi?
I don't want to use the API's available.
Kindly help.
Vini
|
|
|
|
|
How to insert JSP tag by using mshtml.
senmah
|
|
|
|
|
Hey all.
I've got a text file that I am trying to modify, but am running into some problems. Here's the code that I am using:
CStdioFile myFile;
myFile.Open("c:\\temp\\test1.txt",CFile::modeReadWrite);
myFile.Seek(40,CFile::begin);
myFile.WriteString("this is the replaced line\n");
myFile.Close();
It kind of works, but what is happening is it is overwriting the contents of the next lines and I can't figure out how to get around this. Ie, the file looks like this before I run it
line 0
line 1
line 2
line 3
line 4
line 5
line 6
line 7
line 8
line 9
then, after i execute the above statements
line 0
line 1
line 2
line 3
line 4
this is the replaced line
e 8
line 9
So, when the newly modified text is written, if it happens to be longer than the original line, it will write over other lines below it, instead of "appending" so to speak, making the file look like:
...
line 3
line 4
this is the replaced line
line 6
line 7
line 8
... if I do something like "...WriteString("line Z"), it replaces it fine because the new string matches the length of the one that's in the file. Any ideas on how to replace an entire line in a text file (each line is ended with \n) without overwriting following lines?
Thanks
|
|
|
|
|
U have to store remaining lines( after 4 line) in some other temporary buffer , then insert what ever content u want insert , once again append temporary buffer.
|
|
|
|
|
hi,
How can i make Directory at Run time ona specifc Path if it is not there.... nad if it is already present how can i chk it..
thanx
|
|
|
|
|
One solution is CreateDirectory().
Kuphryn
|
|
|
|
|
if the Directory is already Exist ... then i not wanna that to show my client it is already
i just want to skip that step..
how can i do it
|
|
|
|
|
The OS will not create the directory if it already existed.
Kuphryn
|
|
|
|
|
You may check if the folder exists with GetFileAttributes()
|
|
|
|
|
Wildcards don't seem to work in CFile::Remove, for example:
CFile::Remove("c:\\junk\\*.dat"). Should this work or is there a better (correct) way?
|
|
|
|
|
You need to do a file search for wild cards like using CFindFile in MFC and other Win32 APIs provided.
Sonork 100.41263:Anthony_Yio
Life is about experiencing ...
|
|
|
|
|
Perhaps SHFileOperation would help?
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
can someone help me with or point me in the right place so i can figure out how to use a button to copy from a edit box i can do it but i have to click on the edit box first then click the button and i dont want to have to do it that way
|
|
|
|
|
Simply add a message handler for the button click. Access the edit control's text via GetWindowText().
Kuphryn
|
|
|
|
|
I am trying to create a DLL plugin to another application which launches an MFC CFrameWnd from a function in the DLL that gets called by the application. The problem I am having is that some of my messages are going missing. The message that highlights the menu when the Alt key is pressed is missing and the menu does not get highlighted. Also, I have a CDialogBar control that the Tabs and Enters do not work.
I have created a Regular MFC DLL in .NET 2003 but I do not create the window in the CWinApp InitInstance function. I create it in a seperate function that gets called by the parent application that consumes the DLL. I am thinking that this might be the cause of my problem but I do not want to create the window when the plugin gets loaded. Should I be creating an MFC Extension DLL instead?
Any ideas what could be going wrong?
Thanks
|
|
|
|
|
|
Hello everyone,
I want to use the CArray template class, but I am having difficulty getting it loaded. What I mean is that when I load the header file that defines it, "afxtempl.h", I get the following error:
[code]
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxv_w32.h(18):
fatal error C1189: #error : WINDOWS.H already included.
MFC apps must not #include <windows.h>
[/code]
I'm kind of stuck as to what to do. I noticed that code posted online seems to include "stdafx.h" instead of "afxtempl.h". I think this file is a generated file, but I'm not sure how to go about generating it.
This is my first post, so please let me know if I need to include additional information.
Thanks,
-Jash
|
|
|
|