|
Theo Buys wrote: The best you can put them in a include file under the [ALIAS] and [MAP] key
Can I use #include and #define statements in HTML Help Workshop projects? What should I do to be able to do that?
I have a project where we have different versions (like a Demo and a Full version), and it'd be nice to be able to change the program name according to which version I'm building, without 2 separate html help projects where this is the only difference.
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
|
Hi all.
in preview window many buttons are present like,
Print,NextPage,PrevPage,ZoomIn,ZoomOut,Close.
i want to hanle the Close button.
please tell me how can i handle it.
thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
There is a function called CDC::IsPrinting
When you try to close the preview window OnClose function will be called and you can check whether you have closed the window through print preview by checking the IsPrinting Flag .
|
|
|
|
|
No its not working please explain with example
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
Hi there is a virtual function called OnEndPrintPreview
void CExamp1View::OnEndPrintPreview(CDC* pDC, CPrintInfo* pInfo, POINT point, CPreviewView* pView)
{
AfxMessageBox ("Data");
CView::OnEndPrintPreview(pDC, pInfo, point, pView);
}
use this i will sure it will work
|
|
|
|
|
Thanks
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
Hi All
Removable hard disks ( USB hard disk ) are being displayed even when selected drive type is Local Disk. This problem doesn't occur with removable flash drives.
How can i show Removable hard disks ( USB hard disk )is a Logical Drive?Plz help me
|
|
|
|
|
Hello All,
I am doing an SDI application in MFC(.Net 2008 platform). In my project, when i click on any button, i have to create a child window in the mainframe window. This child window having no caption, title bar, system menu. i want only border for that window. This child window will always be displayed on the Mainframe window, even i click anywhere on the mainframe window.
I have created window using Create() function and Set its position using SetWindowsPos() function. as follwing;
**************************
CFrameWnd* pFrame ;
pFrame = new CFrameWnd;
pFrame->Create(NULL,NULL, WS_OVERLAPPEDWINDOW ,rect,NULL,NULL,0,poContext);
pFrame->ModifyStyle(WS_CAPTION + WS_OVERLAPPEDWINDOW + WS_TILEDWINDOW, WS_BORDER,SWP_+ SWP_NOMOVE +SWP_NOZORDER );
pFrame->InitialUpdateFrame(pDocument,TRUE);
pFrame->SetWindowPos(&CWnd::wndTopMost,x,y,x1,y1,SWP_SHOWWINDOW);
pFrame->ActivateFrame(SW_SHOWNORMAL);
**************
Now the problem is that, when i minimize the Mainframe window, child window always be there on the screen. i want to minimize this child window also along with Mainframe window. How can i do this. Please give me any hint with the help of code.
Which flag i have to set while creating the window or in the SetWindowPos() function.?
Also when i create child window, its name is displayed on the taskbar, when it is created. I dont want to show this entery on the taskbar.
Thnaks in advance.
|
|
|
|
|
i have a dialog box and in dialog box there r 4 check boxes.whenever check box is checked it becomes 1 and for unchecked, value becomes 0.so user may check or uncheck the check boxes according to that i need to get the values of check boxes and i need to convert it into decimal.
eg 1)if 1st and 2nd checkboxes are clicked then it will be as 1100
2)if 1st and 4th check boxes are checked then it becomes as 1001 and
3)if 2nd check box is checked then it becomes as 0100
i want to convert this value to decimal, how can i do this?
thanks in advance.
|
|
|
|
|
You just need to obtain the state of the check box and use some simple bitwise operations. You'll want to do something like this:
int myNumber = 0;
if (checkBox4.isChecked()) myNumber &= 1;
if (checkBox3.isChecked()) myNumber &= 2;
if (checkBox2.isChecked()) myNumber &= 4;
if (checkBox1.isChecked()) myNumber &= 8;
How you determine the checkbox's state is up to you.
|
|
|
|
|
enhzflep wrote: You just need to obtain the state of the check box and use some simple bitwise operations. You'll want to do something like this:
int myNumber = 0;
if (checkBox4.isChecked()) myNumber &= 1;
if (checkBox3.isChecked()) myNumber &= 2;
if (checkBox2.isChecked()) myNumber &= 4;
if (checkBox1.isChecked()) myNumber &= 8;
Two notes:
- AFAIK there's no
isChecked method available (even CMFCButton has IsChecked , i.e. starting uppercase). - The correct bitwise operator is OR (
| ), instead of AND (& ).
Be careful when proposing code.
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]
|
|
|
|
|
hi there,
i'm trying to set up a hash map such as:
class ObserversByMessageMap :
public stdext::hash_map<messagekey,>
{};
and i've got MessageKey defined with these operators:
bool operator==(const MessageKey& other)const;
bool operator!=(const MessageKey& other)const;
bool operator<(const MessageKey& other)const;
bool operator>(const MessageKey& other)const;
operator size_t(void)const;
something doesn't work quite right however. i'm trying to do something like:
MessageObserverSet& observers = (*m_observersByMessageMap)[key];
observers.insert(observer);
but it appears that the map (either hash or map) seems to collide with a *different* key than what i expect, and therefore adds the observer to the wrong pre-existing key.
i figured the operator==() is supposed to prevent that from happening, but it aint being called. instead the size_t hash is called and also the < operator, which i've defined as:
bool
MessageKey::operator<(const MessageKey& other)const
{
bool lessThan = false;
if(m_messageId <= other.m_messageId)
{
if(m_objectId < other.m_objectId)
{
lessThan = true;
}
}
return lessThan;
}
since m_objectId is a nested object.
any ideas? in mfc this kind of stuff worked no problem...
|
|
|
|
|
My directory structure is like the following
Solution Directory
--Project1
--Project2 From Project2 , I have to use classes written in Project1 . I have included the header files like the below in Project2
#include "../Project1/SomeHeader.h" I can see the classes in intellisense but the problem occured with linker. It is saying about unresolved external symbols.
I am looking for a method to link the file to Project1 . Any thoughts?
EDIT:
I solved it by adding the project dependencies. Right click on the project -> Project dependencies -> Check the Project1 , save and build.
I'd like to hear from you guys that is this the right approach to solve the above described problem?
Thanks
modified on Monday, December 29, 2008 11:25 PM
|
|
|
|
|
What kind of projects are Project1 and Project2 ? Is Project1 a library ? If yes, then your approach is the correct one (of course you need to add the library in the project settings of Project2).
|
|
|
|
|
Cedric Moonen wrote: Is Project1 a library
Yes. Project1 is a library.
Cedric Moonen wrote: of course you need to add the library in the project settings of Project2
Did you mean the linker settings? If yes, I haven't done that but the build and linking was successful. Am I missing something?
|
|
|
|
|
Christian Flutcher wrote: If yes, I haven't done that but the build and linking was successful
That's a bit strange... Normally you should have added it in the project properties: "Linker" category" -> "Input" and you should add it in the "Additional Dependencies".
EDIT: or another way to do it is to make use of a #pragma. That's what you did maybe ? In such case, you don't need to change the properties of project 2.
|
|
|
|
|
Hi!
I have been trying for hours now to get a code snippet to work. It's just a simple little code that is supposed to write an audio stream in a newly created avi file. I've worked out writing bitmaps but this just won't work! I get no errors from AVIStreamSetFormat and no error from AVIStreamWrite() but when I listen to the resulting avi file I just hear random noise (this plus the fact that my code crashes when I try to write bigger chunks of data leads me to believe that AVIStreamWrite tried to write from memory I did not tell it to).
Here's my code:
#include <windows.h><br />
#include <iostream><br />
#include <vfw.h><br />
#pragma comment (lib,"Vfw32.lib")<br />
using namespace std;<br />
<br />
#define INPUT_WAVE L"C:\\cosmic.wav"<br />
#define OUTPUT_AVI L"C:\\testarN.avi"<br />
<br />
struct WAVE_HEADER<br />
{<br />
char ChunkID[4];<br />
int ChunkSize;<br />
char Format[4];<br />
char SubChunk1ID[4];<br />
int SubChunk1Size;<br />
short AudioFormat;<br />
short NumChannels;<br />
int SampleRate;<br />
int ByteRate;<br />
short BlockAlign;<br />
short BitsPerSample;<br />
int Subchunk2ID;<br />
int Subchunk2Size;<br />
};<br />
<br />
<br />
int main ()<br />
{<br />
DeleteFile(OUTPUT_AVI);<br />
DWORD meh;<br />
<br />
HANDLE fhandle;<br />
fhandle=CreateFile(INPUT_WAVE,GENERIC_READ,0,NULL,3,0,NULL);<br />
<br />
<br />
WAVE_HEADER wh;<br />
cout << sizeof(wh) << endl;<br />
ReadFile(fhandle,&wh,sizeof(wh),&meh,NULL);<br />
<br />
cout << wh.Subchunk2Size << endl;<br />
<br />
<br />
BYTE *audiodata = new BYTE[wh.Subchunk2Size];<br />
ReadFile(fhandle,audiodata,wh.Subchunk2Size,&meh,NULL);<br />
cout << meh << endl;<br />
<br />
<br />
<br />
<br />
PAVIFILE avifile;<br />
PAVISTREAM avistream;<br />
<br />
AVIFileInit();<br />
<br />
AVIFileOpen(&avifile,OUTPUT_AVI,OF_CREATE,NULL);<br />
<br />
WAVEFORMATEX wfx;<br />
memset(&wfx,0,sizeof(wfx));<br />
wfx.wFormatTag=wh.AudioFormat;<br />
wfx.nBlockAlign=wh.BlockAlign;<br />
wfx.nAvgBytesPerSec=wh.ByteRate;<br />
wfx.nChannels=wh.NumChannels;<br />
wfx.wBitsPerSample=wh.BitsPerSample;<br />
wfx.nSamplesPerSec=wh.SampleRate;<br />
<br />
AVISTREAMINFO asi;<br />
memset(&asi,0,sizeof(asi));<br />
asi.fccType=streamtypeAUDIO;<br />
asi.dwScale=wfx.nBlockAlign;<br />
asi.dwRate=wfx.nSamplesPerSec*wfx.nBlockAlign; <br />
asi.dwQuality=-1;<br />
<br />
<br />
AVIFileCreateStream(avifile,&avistream,&asi);<br />
cout << avistream << endl;<br />
<br />
<br />
cout << AVIStreamSetFormat(avistream,0,&wfx,sizeof(wfx)) << endl;<br />
<br />
cout << wh.Subchunk2Size/(wh.BitsPerSample/8)/wh.NumChannels << endl;<br />
cout << AVIStreamWrite(avistream,0,100*1000,<br />
&audiodata,100*1000*2,0,0,0) << endl;<br />
<br />
<br />
<br />
AVIStreamRelease(avistream);<br />
AVIFileRelease(avifile);<br />
AVIFileExit();<br />
<br />
delete [wh.Subchunk2Size]audiodata;<br />
<br />
CloseHandle(fhandle);<br />
<br />
return 0;<br />
}<br />
<br />
<br />
<br />
</vfw.h></iostream></windows.h>
I've used resources from the following places:
http://msdn.microsoft.com/en-us/library/ms712636(VS.85).aspx[^]
http://ccrma.stanford.edu/courses/422/projects/WaveFormat/[^]
http://www.adp-gmbh.ch/win/programming/avi/avi.html[^]
Hopefully someone can take the time to look over my code and give me some suggestions.
Thanks in advance!
|
|
|
|
|
Could someone help me / point me to where I can find a source code of this API?
No such thing in Google searches.
Thanks for reading
Vaclav
|
|
|
|
|
|
Also sorry, but I am not looking for applications of this API.
Unless I have missed it, in your search, all of these are just that - applications of capCreateCaptureWindow.
capCreateCaptureWindow "creates" preview of the AVI frame and I am assuming that it does it using bitmap. I like to see the actual source code for it.
Anyway, thanks for your help.
Vaclav
|
|
|
|
|
I get the following error upon program close - NOT while program is running, but when it shuts down:
'Notify.exe': Loaded 'C:\Windows\System32\rsaenh.dll'
First-chance exception at 0x01001df6 in Notify.exe: 0xC0000005: Access violation reading location 0xfeeefeee.
Unhandled exception at 0x01001df6 in Notify.exe: 0xC0000005: Access violation reading location 0xfeeefeee.
How do I find the error. Doesn't happen in Debug compilation l only in Release mode.
A C++ programming language novice, but striving to learn
|
|
|
|
|
Larry Mills Sr wrote: I get the following error upon program close - NOT while program is running, but when it shuts down
Welcome in the CP's memorable quotes [^].
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]
|
|
|
|
|
More information is needed. How do you know it involves a CString if the application is third party? The rsaenh.dll is a Microsoft DLL which provides cryptographic functionality. The 0xfeeefeee value is heap memory that has been deleted.
Btw, you can attach the visual studio debugger to release builds.
How to: Debug a Release Build[^]
Best Wishes,
-David Delaune
|
|
|
|
|
I say CStringT because that is what is shown when I ask for debug info ie,
" ~CStringT
{
}
"
I'm already setup for release build debugging. But as I said I don't use CStringT I use only CString.
A C++ programming language novice, but striving to learn
|
|
|
|
|