|
hi
I need to know where i can find some code to study thru
iv'e looked but only finds snippets i want like complete
applications that i can study and work thru
they say its a good thing to do
regards
|
|
|
|
|
have a look at all the linux/bsd programs, and at some of the other freeware software out there.
http://sourceforge.net/[^] is a place to look for applications with source code.
There a a couple of windows applications available on sourceforge.
Have fun.
Maximilien Lincourt
"Never underestimate the bandwidth of a station wagon filled with backup tapes." ("Computer Networks" by Andrew S Tannenbaum )
|
|
|
|
|
Code Project is choke full of code, both snippets and full programs.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Hi all,
This is a very simple question.. Please help.. I am using an edit box to input user address..and this edit box property multiline property is true..but when i enter data into that edit box..it doesnt understand enter to go to next line..instead it goes to OK button..please help me to make it behave like it should.. Any help is highly apprecaited..
thanks a lot in advance..
regards
himanshu
|
|
|
|
|
Does the edit control have the ES_WANTRETURN style?
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Thanks a lot..it did my work..
Himanshu
|
|
|
|
|
Recently I downloaded a file with the extension, ".hpp", and promptly changed it to ".h" before adding it to my project.
Ever since I did that, I've had nothing but problems with that file, and was wondering whether there might have been something different between those two extensions that should have been handled before using it.
Thanks for any insight.
William
Fortes in fide et opere!
|
|
|
|
|
The ".hpp" normally says that it is a c++ Header Files (cause the c++ source files are called ".cpp")
Beside beeing a naming convention (which is not popular at all when programming with Microsoft C++) it has (as much as i know) nothing to do with the way they are interpreted.
If you feel funny i guess you can change the extension of a header file to any name you want.
(e.g. the STL Headers come all without any Extension)
I just seen hpp from people programming not with Visual Studio. (Altough i think it would be more clear than .h)
"I'm from the South Bronx, and I don't care what you say: those cows look dangerous." U.S. Secretary of State Colin Powell at George Bush's ranch in Texas
|
|
|
|
|
WREY wrote:
I've had nothing but problems
Which type of problems? Your girlfriend did run away with a VB-coder?
When adding the file to your VC++ project (VC++6, right?), did you add it at the right place?
Under the 'header files' folder? You did put it into the right directory for your project?
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
I want to program a ActiveX control.
It reads data from file, and show it.
(a kind of viewer)
Q1.
When i use this control in some html page,
i can use <object> or <embed /> tag.
But i don't know the difference between two tags.
(For exam, in <object> tag, codebase parameter decribes the link of install package, but what's the pluginpage paramter in <embed /> tag?)
And in the flash object insertion example, <embed /> tag is in the <object> tag, why?
When I tested html that have only <embed /> tag without <object> tag, it works well.
Q2.
When I develop the ActiveX control that is a kind of viewer, Does IE download the input file or does ActiveX control download?
How about the case of <embed /> tag?
--flash object example--
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
="" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="150" height="316">
<param name="movie" value="http://images.joins.com/common/joins_022.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#FFFFFF" />
<embed src="http://images.joins.com/common/joins_022.swf"
="" quality="high
" bgcolor="#FFFFFF
" width="150" height="316
" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" />
|
|
|
|
|
I've a simple dialog based application, in which when i press OK button, a modeless dialog is created :
CParentDialog::OnOk()
{
CModelessChildDialog *pChild;
pChild = new CModelessChildDialog ();
pChild->Create(IDD_DIALOG1);
pChild->ShowWindow(SW_SHOW);
}
I want the desktop window to be the parent of my modeless dialog, so that it can be "separated" from the window which initiated it. For this purpose i am doing something like:
BOOL CModelessChildDialog::OnInitDialog()
{
SetParentWindow(GetDesktopWindow);
}
But still the modeless dialog is tightly coupled with the main application dialog that initiated it. I want my modeless dialog to be completely separated from the dialog that initiated it. How can i do so
|
|
|
|
|
Didn't you mean
pChild->Create(IDD_DIALOG1, GetDesktopWindow());
instead? If not, and you still wanted to do it in the dialog's OnInitDialog() method, change SetParentWindow() to SetParent() !
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Please, Can anybody helps me ?
I want to catch the CWnd pointer for the current dialog to use it in the CButton::Create() method. I tried to use "this" instead of CWnd in the OnButtonClick() its works ok, but when I tried to use "this" inside Custom Class (I created it) it doesn't work because the "this" pointer was pointing to the Current class.So " How can I get CWnd pointer for the current dialog ? "
Thank you at all.
Dr Abudawood
|
|
|
|
|
class Custom public CWnd
{
Custom()
{
CWnd* pWnd = static_cast<CWnd>this;
}
}
I think it will work, I don't know.
Rickard Andersson
Here is my card, contact me later!
UIN: 50302279
Sonork: 37318
Interests: C++, ADO, SQL, Winsock, 0s and 1s
|
|
|
|
|
i have serveral dialogs within an SDI.I need to take in user inputs through the dialogs and then based on these information, draw a graphic and show it on the SDI view, my problem is, i do not know where should i code this part, as i need info from 2-3 dialogs, so does that mean i link my user inputs in these dialogs to the document class then output to view? please advise....actually my project has a "view" button on each of the 3 dialogs such that when any one is pressed, the view panel will show the required image....
Also, how to draw small boxes to represent a 1 for a "pixel" that is present and 0 for a "pixel" that is etched away? urgent!
|
|
|
|
|
Hi,
my software did a lot of file access using MFC/CFile and did it very well as long as the files are not corrupted. In meantime the software has to deal with files on DVD+-R and +-RW media. Lots of them seems to be corrupted. When i did a File->Read to such a file (just a few bytes), this call takes seconds (between 10 to 20s) till it comes back (the file->open was quick and ok).
Question:
How can I react on that? If i tried to copy that file on the desktop the system tolds me within 0 to 2s that this file is not ok.
How can i do a QUICK check on small files (up to 100kByte) in advance for CRC errors and so on?
And what about very large files >Gbyte?
Thanks a lot for your help!
Eddie
|
|
|
|
|
It is a good idea to make such unsure function in another Thread. Then you start the thread and your original programm is running further and you can check the status of the thread.
PS: I do some network checking in threads and it works very well for me.
Try this @ home. (B&B)
|
|
|
|
|
dear all,
finally i managed to put myself into a number of wierd problems.....without any clue WHY and WHY ME?
these problems are :-
1) my app is a very simple dlg based mfc app. i'm unable to terminate the dialog by pressing the cross button in the top right corner..even Alt+F4 can't terminate my mighty dialog.
2) i'm using string comparision function as
<br />
if (sDir.CompareNoCase("M") != 0)<br />
{<br />
<br />
}<br />
i call this piece of code on click of a button. Everythiing is working fine in Xp, but in 2000 if i click on the button using mouse...the string comparision seems ok, but when same string is supplied and mouse is pressed using keyboard (enter or space bar), plz. (pause for a laughter)....the string comparision fails.
All i want to know is what is wrong with the code, or with me
Regards,
rIsHaBh
|
|
|
|
|
rishabhs wrote:
1) my app is a very simple dlg based mfc app. i'm unable to terminate the dialog by pressing the cross button in the top right corner..even Alt+F4 can't terminate my mighty dialog.
Have you done something to OnCancel() or OnClose() ?
rishabhs wrote:
...the string comparision fails.
What is the value of sDir at the point of comparison?
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
1) haven't even touched OnCancel or OnClose()
2) value of sDir is "M"
any clues!!
rIsHaBh
|
|
|
|
|
If you create a dialog-based application, don't change anything, and run it, does the "X" (close) button behave as expected?
Have you stepped into the CompareNoCase() code to see why it is failing? What if you changed the code to:
char s[] = "M";
if (sDir.CompareNoCase(s) != 0)
{
...
} Does that make a difference?
|
|
|
|
|
I have the following case:
There's a Window, let's call it window A.
Window A contains a nested class which implements a COM-Interface.
the code behind window A is simple:
<br />
CWindowA* wndA = new CWindowA;<br />
wndA->DoModal();<br />
delete wndA;<br />
This code appears in the middle of an application, it has lots of stuff before and after it.
The thing is, that Window-A gives 'someone' a pointer to it's COM-Interface. This someone proceeds to make COM calls which are executed inside Window-A's nested class.
The design issue is this, Window-A decides it's time to die (call EndDialog, and thus get out of the DoModal() loop and get desturcted) in response to a COM call from mr. 'someone'.
So, if 'someone' makes this final COM-call, Window-A in response starts to destroy itself, and actually gets to it, without having 'someone' release the refcount it has on Window-A's COM-Object. This causes a mess/Assertion by MFC on the fact that references to this object still exist.
Is there a nice and clean way to solve this situation ?
It is assured that once this final call is made, the reference-count will be released and no COM-calls will be made to this object.
I've thought of posting a message that would cause a destruction and other numerous solutions, but none of them can assure that the ref-count is actually released...
Thank you
|
|
|
|
|
I've found this : void CCmdTarget::ExternalDisconnect()
the comment in the code states :
// ExternalDisconnect is used to remove RPC connections in destructors. This
// insures that no RPC calls will go to the object after it has been
// deleted.
This looks like a great solution. The only thing I'd like to final-check is that it would be ok to make this call in-response, or during the last COM-Call ?
thanks
|
|
|
|
|
hi,
This problem is specific to a third party code which uses DIRECTX to render a 3-D image on the screen. I do not have acces to the third party software which does this job. My intention is to somehow do the same job but instead of calling the DIRECTX code written in the third party software the client needs to go thru my code for doing the same job. For this I will need to identify the interfaces(directx interfaces) that are being called by the program to render the image on the screen. Is there any way of finding out the interfaces that are being invoked.
As per my knowledge the GUID's of the interfaces are present in the registry. Can we find out the sequence of interfaces being called by the client and then replace the rspective entries in the registries with our interface GUID's so that the screen coordinates( for the image to be rendered on the screen) are available to my program and I need to store it for further processing.
1) How do i implement the concept mentioned above
2) is there any other way of doing it???
Please reply soon
Thanks
|
|
|
|
|
Have you taken a look at D3DSpy, which ships with the DirectX 9 SDK? It may provide the information you're looking for.
- Mike
|
|
|
|