|
Did you try signtool? E.G., signtool sign "$(TargetPath)"
(in your post build step)
HTH,
- Ed.
--------------------------------
|
|
|
|
|
Hi all,
I have created an application that described in this link http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmform95/htm/writingvideoimagesamples.asp[^]
and my code is like below :
int _tmain(int argc, _TCHAR* argv[])
{
IWMWriter *writer = NULL;
IWMProfileManager *manager = NULL;
IWMProfile *profile = NULL;
IWMStreamConfig *stream = NULL;
IWMCodecInfo2 *codecInfo = NULL;
IWMMediaProps *mediaProps = NULL;
WM_MEDIA_TYPE *mediaType = NULL;
HRESULT hr = S_OK;
CoInitialize(NULL);
hr = WMCreateProfileManager(&manager);
hr = manager->QueryInterface(IID_IWMCodecInfo2, (void**)&codecInfo);
hr = manager->LoadProfileByID(WMProfile_V80_256Video, &profile);
//searching for codec that support WMMEDIASUBTYPE_WVP2
DWORD infoCount = 0;
hr = codecInfo->GetCodecInfoCount(WMMEDIATYPE_Video, &infoCount);
for(DWORD i = 0; i < infoCount; i++)
{
hr = codecInfo->GetCodecFormat(WMMEDIATYPE_Video, i, 0, &stream);
hr = stream->QueryInterface<iwmmediaprops>(&mediaProps);
DWORD mediaSize = 0;
hr = mediaProps->GetMediaType(NULL, &mediaSize);
mediaType = (WM_MEDIA_TYPE*) new BYTE[mediaSize];
hr = mediaProps->GetMediaType(mediaType, &mediaSize);
if(mediaType->subtype == WMMEDIASUBTYPE_WVP2)
{
break;
}
else
{
mediaProps->Release();
mediaProps = NULL;
stream->Release();
stream = NULL;
delete [] mediaType;
mediaType = NULL;
}
}
hr = manager->CreateEmptyProfile(WMT_VER_9_0, &profile);
stream->SetStreamNumber(1);
hr = profile->AddStream(stream);
CoInitialize(NULL);
hr = WMCreateWriter(NULL, &writer);
/*error appears below, code : NS_E_INVALIDPROFILE (0xC00D0BC6L)*/
hr = writer->SetProfile(profile);
return 0;
}
|
|
|
|
|
hi,
I want draw staic Color With a color.I have Taken CBrush m_myBrush;
In OnInitDialog() function ...i have created the SolidBrush.
m_brush.CreateSolidBrush(RGB(255,0,0));
I have overriden OnCtlColor() function;
HBRUSH CMyDialogDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
if (pWnd->GetDlgCtrlID() == IDC_MYSTATIC)
{
// Return handle to our CBrush object
return (HBRUSH)m_brush;
}
return hbr;
}
Now in OnOk() function on buttuon click i want to change the color of static control from Red to Green..
void CMyDialogDlg::OnOK()
{
// TODO: Add extra validation here
DeleteObject(m_brush);
m_brush.CreateSolidBrush(RGB(0,255,0));
PostMessage(WM_CTLCOLOR);
//CDialog::OnOK();
}
But it is not working.......Application is crashing.
|
|
|
|
|
GetDlgItem(IDC_MYSTATIC)->Invalidate(); will force the static to redraw itself and in the process send a WM_CTLCOLOR to the dialog.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Please can you be clear i did not get it.I want to change the color of the Static Control from RED to GREEN by Button Click;
|
|
|
|
|
Instaed of sending the WM_CTLCOLOR message invalidate the static control
GetDlgItem(IDC_MYSTATIC)->Invalidate();
nave
|
|
|
|
|
Ok Instead of posting WM_CTLCOLOR message
i have wrote in OnOk;
GetDlgItem(IDC_MYSTATIC)->Invalidate();
But how do i chage the COlor of the Static Control from Current RED Color to GREEN COlor;
|
|
|
|
|
OnOk()
{
m_brush.DeleteObject();
m_brush.CreateSolidBrush( RGB(0,255,0));
GetDlgItem(IDC_MYSTATIC)->Invalidate();
}
Let me know if the above code dosen't't work
nave
|
|
|
|
|
Try This !!
Just put these lines in your 'CMyDialogDlg::OnOK()'
DeleteObject(m_brush);
m_brush.CreateSolidBrush(RGB(0,255,0));
GetDlgItem(IDC_MYSTATIC)->Invalidate();
PostMessage(WM_CTLCOLOR);
-Malli...!
|
|
|
|
|
|
Try Removing 'Postmessage()'. Don't Post Any Msg.
-Malli...!
|
|
|
|
|
Hi,
if(m_brush!=NULL)
DeleteObject(m_brush);
bye,
Cool Ju
Dream Ur Destiny
|
|
|
|
|
i have tried removing the PostMessage() and even the code given by everyone but still application is crashing.
Let me be Clear , I have Created CBrush m_MyBrush; and in OnInItDialog() function i have Created Solid Brush m_MyBrush.CreateSolodBrush(RGB(255,0,0));
In OnCtlColor()
if (pWnd->GetDlgCtrlID() == IDC_MYSTATIC)
{
// Return handle to our CBrush object
return (HBRUSH)m_brush;
}
Now the RED color Has to be Changed to GREEN in OnOk() function...
I have tried all the case given by our Buddies..pls help..
|
|
|
|
|
Thank q every one its working .......Thanks for the help
|
|
|
|
|
I've got an example here. Look in the Extras section.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
I had exactly (well ALMOST...) the same requirement. After many inquiries to experienced developers I finally had to find the solution for myself...
1.) Hand-edit the RC file (text mode) to set your static control to OWNER-DRAW. E.G.,
CTEXT "AUTH",IDC_StatAuth1,177,139,28,10,SS_CENTERIMAGE |
SS_SUNKEN | SS_OWNERDRAW | WS_BORDER | NOT WS_GROUP
2.) Override the OnPaint() handler (you don't need the OnCtlColor handler...) an example snippet follows fom the OnPaint() handler:
CWnd* pStat = m_pDlg->GetDlgItem(GetID());
CDC * pDC = pStat->GetDC();
CRect rect;
pStat->GetClientRect(&rect);
pDC->FillSolidRect(&rect, m_nRgbColor);
pDC->SelectObject(m_pDlg->GetMLEDisplayFont()); // Select presized font
pDC->DrawText(m_strText, &rect, DT_VCENTER | DT_CENTER | DT_NOCLIP);
pStat->ReleaseDC(pDC);
The problem is, with static controls is that the background is always drawn by the framework unless you specify owner draw, and the AppWiz (now non-existant in newer VS editions...) never thought of you wanting to owner draw a static control. Thus you have to edit the .rc file by hand.
Work good, no crash!
- Ed.
--------------------------------
|
|
|
|
|
Hi,
I am writing test cases for a project. one of the source file contains export functions along with some other class definitions and implementation. Now when i declare a class instance and invoke one of the function with possible set of parameters(by including that cpp in my application) i am getting the following error(for all the export functions)
error C2491: 'VXItelInit' : definition of dllimport function not allowed.
How to go about this.
Subramanyeswari
|
|
|
|
|
subramanyeswari wrote: Now when i declare a class instance and invoke one of the function with possible set of parameters(by including that cpp in my application)
You should not include the .cpp the file but the .h file. Because .cpp files contain the definitions of the functions declared in .h file.
Definitions are included when you link to the dll . So no need for .cpp files here.
Nibu thomas
Software Developer
|
|
|
|
|
The .h file contains one structure definition and 4 export function declarations. No other class definitions whereas the .cpp file contains the class definitions(ex..VXItelImpl is a class defined in .cpp and its implementation is also there in .cpp)not .h file. We write test cases for the four export functions. Now we have to cover the other class definitions and implementations which are declared in .cpp.
So i can't avoid including the cpp or is there any other option.
Regards
|
|
|
|
|
subramanyeswari wrote: (ex..VXItelImpl is a class defined in .cpp and its implementation is also there in .cpp)not .h file.
This is bad.
I can suggest you this. Since you are having both .cpp and .h files you can remove the export qualifiers for classes as well as functions.
Nibu thomas
Software Developer
|
|
|
|
|
Hello Subramanyeshwari !
you just try to separate your implementation part and definition part using .cpp files and .h files. Did you check that your .cpp file has been include in more that one file? And try to put some code description over here to get more clarity !
-Malli...!
|
|
|
|
|
can i hide a modal dialog box while opening the .exe?
JAYARAJ
|
|
|
|
|
|
what is conversion regular from int to dotted ?
|
|
|
|
|
inet_ntoa()
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|