|
Is that another API call?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->ßRÅhmmÃ<-·´¯`·.
|
|
|
|
|
tangocharlie40 wrote: Do you people have any idea on how to create a home banking system using Visual C++?
Google for gnucash.
But remember to publish any of the changes you make to the code: Its under GPL.
Or, as an alternative, you think about what your homework should do, write it down in real sentences ad present it here. We might feel like giving you a hint or two, if we get the feeling that you really try to work on it.
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|
I have a window without a sizing border and I would like to add the sizing functionality to it (without adding the WS_THICKFRAME style) it is an irregular shaped window. I was wondering if there is a quick and simple way to fake sizing the window. Similar to SendMessage(WM_SYSCOMMAND, 0xF012) in the Left Button Down handler.
Thanks
|
|
|
|
|
Hi,
only an idea:
You test on the mouse-move handler if the mouse position is on a "border"
then you change the mouse-cursor into a sizing-cursor.
On each Left-Button-Down, you need also to check if the mouse-cursor is on a border.
If so, you set a Pressed-Flag to 1 and if the mouse is beeing moved and pressed = TRUE,
you should calculate the new position and set a MoveWindow(......); to adapt it to the window.
If the mouse is beeing released, pressed = FALSE;
I wish you good luck
|
|
|
|
|
I will be attempting that type of solution tomorrow. I was really hoping for a one line fix like the one I mentioned about window dragging. I appreciate your suggestion anyway, thanks.
|
|
|
|
|
Hi,
I know when a file is opened in exclusive mode no other application or process can access it.
But I want to open and also view the file in exclusive mode, say a PDF file.
Actually I need to restrict cut & copy permission for a file when it is opened.
Is this the right approach?
Is there any possible solution? Any suggestions would be helpful.
Thanks
Satya
Today is a gift, that's why it is called the present.
|
|
|
|
|
What the hell is opening a file in exclusive mode having to do with imposing copy/paste restrictions? Look at CFile::shareExclusive if you just want to open a file in exclusive mode.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->ßRÅhmmÃ<-·´¯`·.
|
|
|
|
|
When the file is opened in Exclusive mode and meanwhile if I try to copy and Paste the file it says "cannot copy It is being used by another person or program".
I want to make use of this condition and would like to open and view the file.
I have an encryted file which I decrypt programmatically to get actual file and open it for viewing. But I dont want every one to copy the file.
So, I would like to open and view it in Exclusive mode and when the file is closed I will programmatically delete the file.
Thanks
Today is a gift, that's why it is called the present.
|
|
|
|
|
I am sorry. I understood that you would like to impose copy/paste permissions (in edit mode, say in an editor) while editing a file. CFile::shareExclusive() will help you if you would like nobody else to copy it or delete it, as you said.
|
|
|
|
|
Hi,
I wanna access data of excel sheet through my mfc application.Can anybody please let me know if it is possible to do so and if yes then please let me know the procedure.
Regards,
Pritam
|
|
|
|
|
Google.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->ßRÅhmmÃ<-·´¯`·.
|
|
|
|
|
There are at least 4 ways to do this. The easy way, the less easy way, the COM way and the really hard way.
The easy way is to save your spreadsheet as a .csv (Comma Separated Value) file and then open it and read in the data. Parsing the comma separated fields is then pretty trivial.
The less easy way is to use ODBC/OLE DB to read the original Excel file as a database. Microsoft publishes a driver/provider for this so you can execute SQL queries against the spreadsheet. Unfortunately the last time I used it it was rubbish and had more gotchas than the Sun newspaper archive.
The COM way is to instance Excel itself as a COM server and use the interfaces it exposes to access the data. If you're into COM this is not actually very difficult because it's all IDispatch based, designed to be used from VB.
The really hard way would be to attempt to read Excel native files directly. This, while technically possible, could prove to be really difficult and is almost certainly not worth the effort.
There's your options, enjoy
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Hi Friends,
I have difficulties in getting handle of EditBox when I get the value of edit box.
Following code is execute correctly when i set value to edit box
CEdit *pOpenEdit = (CEdit *) GetDlgItem(IDC_FOLDER_PATH);
if( NULL != pOpenEdit->GetSafeHwnd() )
{
if( strOpenPath != "" )
pOpenEdit->SetWindowText(strOpenPath);
}
But when I want to get value of edit box , i did not get the
handle of edit box. so it did not entered in if Block.
CEdit *pOpenEdit = (CEdit *)GetDlgItem(IDC_FOLDER_PATH);
if( NULL != pOpenEdit->GetSafeHwnd() )
{
char buff[500];
pOpenEdit->GetWindowText(buff,256);
strOpenLocation = buff;
}
So please let me know what is wrong in this code.
Thanks in Advance
Atul
|
|
|
|
|
Your error is not in the block of code you are showing me.
I would assume that at the time that you are "getting" the value -- your dialog has been closed...
When are you calling this "get"?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.soonr.com">SoonR Inc -- PC Power delivered to your phone</A>
|
|
|
|
|
|
hi all,
i created a new tool bar in my application with 5 buttons. when i click second button the 5th button should be disable .can u please tell me how to disable in coding.
for a normal dialog item we use this code
GetDlgItem(IDC_BUTTON)->EnableWindow(FALSE);
but how to do this for tool bar button.
thanks
panthal
|
|
|
|
|
Have a look at TB_ENABLEBUTTON in MSDN.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->ßRÅhmmÃ<-·´¯`·.
|
|
|
|
|
hi please tell
How i can change custom level of security (for example ActiveX control and plugins) of trusted sites , programmatically?
Is it possible by using IInternetSecurityManager interface?
Thanks.
-- modified at 0:43 Monday 19th November, 2007
-- modified at 5:02 Monday 19th November, 2007
destined to win
|
|
|
|
|
I took the code form http://www.gdcl.co.uk/downloads.htm for mpeg1 parser filter and registered the sample parser with the help of regsvr32. then i wrote the following program to create an exe file to play the sample parser.
here CLSID_SampleWaveParser is the guid that is used for samplewave parser in the mpeg1 file.
When i execute the following code it executes successifully untill the end of the file which ever i have selected but after completion of the file it give the following error.
4 objects left active. in 316 line of dllentry.cpp.
can u tell me how can i remove this error.
or is there any other method to create an executable file for the dll which is created by the mpeg1 wave parser.
#include <InitGuid.h>
#include <DShow.h>
//0xD84E3EC9, 0x3233, 0x4177, 0xA3, 0xAF, 0x13, 0xB6, 0xF9,0x33, 0x49, 0x8D);
// our own definition of Wave Parser based on CLSID we found in registry
#define INITGUID // have to define this so next line actually creates GUID structure
DEFINE_GUID(CLSID_SampleWaveParser,0xD84E3EC9, 0x3233, 0x4177, 0xA3, 0xAF, 0x13, 0xB6, 0xF9,0x33, 0x49, 0x8D);
void main(void)
{
HRESULT hr;
IGraphBuilder* g_pGraphBuilder = NULL; // assume graph builder already created
IBaseFilter* g_pSource = NULL;
IBaseFilter* g_pWaveParser = NULL;
IBaseFilter* g_pSoundRender = NULL;
IFileSourceFilter *pFileSourceInt = NULL;
IMediaControl *gControl = NULL;
IMediaEvent *gEvent = NULL;
IEnumPins* EnumPins = NULL;
IPin* OutPin = NULL;
IPin* InPin = NULL;
ULONG fetched;
PIN_INFO pinfo;
long evCode=10;
CoInitialize(NULL);
CoCreateInstance(CLSID_FilterGraph, NULL,CLSCTX_INPROC_SERVER,IID_IGraphBuilder, (void **)&g_pGraphBuilder);
CoCreateInstance(CLSID_SampleWaveParser, NULL, CLSCTX_INPROC_SERVER, IID_IBaseFilter, (void**)&g_pWaveParser);
CoCreateInstance(CLSID_AsyncReader, NULL, CLSCTX_INPROC_SERVER, IID_IBaseFilter, (void**)&g_pSource);
CoCreateInstance(CLSID_DSoundRender, NULL, CLSCTX_INPROC_SERVER, IID_IBaseFilter, (void**)&g_pSoundRender);
g_pGraphBuilder->AddFilter(g_pSource,NULL);
g_pGraphBuilder->AddFilter(g_pWaveParser, NULL);
g_pGraphBuilder->AddFilter(g_pSoundRender,NULL);
hr = g_pSource->QueryInterface(IID_IFileSourceFilter, (void**)&pFileSourceInt);
hr = pFileSourceInt->Load(L"D:\\test.rpm",NULL);
if( hr == E_FAIL)
printf("\n Failed to open the file\n");
// find source output
g_pSource->EnumPins(&EnumPins);
EnumPins->Reset();
EnumPins->Next(1, &OutPin, &fetched); // only 1 pin for source, so we know this is the one we need
EnumPins->Release();
// find wave parser input
g_pWaveParser->EnumPins(&EnumPins);
EnumPins->Reset();
EnumPins->Next(1, &InPin, &fetched);
InPin->QueryPinInfo(&pinfo);
pinfo.pFilter->Release(); // make sure you release the returned IBaseFilter interface
if (pinfo.dir == PINDIR_OUTPUT) // check if we have wrong pin (not input pin)
{
InPin->Release();
EnumPins->Next(1, &InPin, &fetched); // if so, get next pin
}
// connect
g_pGraphBuilder->Connect(OutPin, InPin);
InPin->Release();
// OutPin->Release();
// find wave parser audio output pin
EnumPins->Next(1, &OutPin, &fetched);
EnumPins->Next(1, &OutPin, &fetched);
OutPin->QueryPinInfo(&pinfo);
if (pinfo.dir == PINDIR_INPUT)
{
OutPin->Release();
EnumPins->Next(1, &OutPin, &fetched);
OutPin->QueryPinInfo(&pinfo);
}
EnumPins->Release();
OutPin->Release();
// find renderer input
g_pSoundRender->EnumPins(&EnumPins);
EnumPins->Reset();
EnumPins->Next(1, &InPin, &fetched); // renderer has only 1 pin, so this is the pin we need
EnumPins->Release();
// connect
g_pGraphBuilder->Connect(OutPin, InPin);
InPin->Release();
OutPin->Release();
hr = g_pGraphBuilder->QueryInterface(IID_IMediaControl, (void **)&gControl);
hr = g_pGraphBuilder->QueryInterface(IID_IMediaEvent, (void **)&gEvent);
hr = gControl->Run();
gEvent->WaitForCompletion(INFINITE,&evCode);
hr = gControl->Stop();
gControl->Release();
gEvent->Release();
g_pWaveParser->Release();
g_pSoundRender->Release();
g_pSource->Release();
g_pGraphBuilder->Release();
CoUninitialize();
}
amiya kumar das
|
|
|
|
|
here CSharpHelloWorld.netmodule is in the bin folder of the managed c++ project
#include <mscorlib.dll>
#include "CSharpHelloWorld.netmodule"
#include namespace System;
public __gc class HelloWorldC
{
public:
CSharpHelloWorld __gc *t; // Provide .NET interop and garbage collecting to the pointer.
HelloWorldC() {
t = new CSharpHelloWorld(); // Assign the reference a new instance of the object
}
// This inline function is called from the C++ Code
void callCSharpHelloWorld() {
t->displayHelloWorld();
}
};
thanks in advance
|
|
|
|
|
Mmmm, what about if you ask in the correct forum? Maybe you get a better answer.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
|
|
|
|
|
Which should I use to delete the instance of class CLadder? OPTION1 or OPTION2? Or something else? CLadder is a dialog class.
//OPTION 1
CLadder* pLD;
pLD = new CLadder:
...
...
...
delete pLD;
//OPTION 2
CLadder* pLD;
pLD = new CLadder:
...
...
...
pLD->DestroyWindow();
|
|
|
|
|
DestroyWindow before delete it.
|
|
|
|
|
It's my understanding that DestroyWindow really just destroy's the HWND (releases the window handle).
The window object should still be intact.
It's very handy to step into that code with the debugger.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.soonr.com">SoonR Inc -- PC Power delivered to your phone</A>
|
|
|
|
|
DestroyWindow is the counterpart to Create and is about the windows-window, the thing you see on screen.
delete is the counterpart of new and is about C++ classes and memory management.
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|