|
Hi Raj,
Thanks for reply, actually I want to do that in C++, may be some API exists for finding an assembly in GAC, that's why I put it here.
Regards,
Mushq
|
|
|
|
|
Mushq wrote: actually I want to do that in C++,
yes, i believe it is .NET framework concepts, you may post in Managed C++ forum. I think there is .NET class library for installing assemblies in GAC, and there should be similar methods to find it also.
|
|
|
|
|
There is a command line utility called
gacutil /l or something like that.
|
|
|
|
|
i am using Date Time Picker for selecting Date and Month.
when i click on this control it display date, month,Year.
but i don`t want year.
can i remove year by code or any property is there ?
varun
|
|
|
|
|
CDateTimeCtrl* pCtrl = (CDateTimeCtrl*) GetDlgItem(IDC_DATETIMEPICKER1);
ASSERT(pCtrl != NULL);
pCtrl-><a href="http://msdn.microsoft.com/en-us/library/0x5f7wz2(VS.80).aspx">SetFormat</a>(_T("dd-MMM"));
|
|
|
|
|
Hi thanks yar
it is working
varun
|
|
|
|
|
I am using the MCIWnd class to play a video within my MFC application. However, the video location in the UI defaults to the upper left hand corner. I am trying to move that location using the MCIWndPutSource function.
Here is what I am trying:
m_Player = MCIWndCreate(GetSafeHwnd(),AfxGetInstanceHandle(),
WS_CHILDWINDOW | WS_VISIBLE | MCIWNDF_NOMENU, name);
RECT *temp = new RECT;
temp->left = 0;
temp->top = 500;
temp->right = 320;
temp->bottom = 740;
MCIWndSetZoom(m_Player, 200);
MCIWndPutSource(m_Player, temp);
MCIWndPlay(m_Player);
After the PutSource call, if I call the GetSource function, it returns back the original coordinates as if I did not move the location at all.
Anyone have an idea why this isn't working, or how I can accomplish this another way?
Thanks for anything.
|
|
|
|
|
|
MCIWndPutSource is to crop the video image, it seems you want to use MCIWndPutDest.
And it seems MCIWndPutSource fails; you haven't checked the return value, because may be the rectangle you specified is out of bound of the video image.
|
|
|
|
|
Rajkumar R wrote: MCIWndPutSource is to crop the video image, it seems you want to use MCIWndPutDest.
I have tried the PutDest function as well. When I use this, the video inside the window shifts, but the window in which it plays does not.
Basically, when the video starts to play, the child window (the video player) defaults to the upper left hand corner. If I use any of the MCI functions, it seems that the video within the player window will shift, but not the window itself which is what I am looking for.
|
|
|
|
|
then you just want to move the MCI child window, m_Player, right? MoveWindow, SetWindowPos.
RECT *temp = new RECT;
temp->left = 0;
temp->top = 500;
temp->right = 320;
temp->bottom = 740;
BOOL MoveWindow(
m_Player
temp->left,
temp->top ,
temp->right - temp->left,
temp->bottom - temp->top,
TRUE
);
remember you are positioning relative to parent window.
I thought you are trying to position the video within the MCI window.
|
|
|
|
|
Rajkumar R wrote: then you just want to move the MCI child window, m_Player, right?
Yes, I want to move the child window, but neither MoveWindow or SetWindowPos allow me to do that from what I can tell.
|
|
|
|
|
I don't remember, try MCIWNDF_NOAUTOSIZEWINDOW in MCIWndCreate if not working, i think you need to move the parent window (that is specify a movable child window as parent window of MCI window)
|
|
|
|
|
Hi,
i am working on a control derived from COleControl class. I want to delete a DC whenever the control get out of focus. But in case when i am pressing window key from the keyboard,
OnKillFocus() function is not working properly. Can anybody suggest an alternate solution.
Thanks.
|
|
|
|
|
IMHO use paint DC which spans only within the paint handler.
|
|
|
|
|
Hi, actually i am using the DC to call DrawDragRect function. On LButtonDown i am capturing the mouse and creating the DC and on LButtonUp i am releasing the capture and deleting the dc. But if user is pressing the the window button, OnLButtonUp is not getting called and the DC is not getting deleted.
Thanks
|
|
|
|
|
I think that is because your application lost capture when windows key is pressed. May be you need to handle the WM_CAPTURECHANGED Notification also.
|
|
|
|
|
Hi,
the application is working fine after using OnCaptureChanged.
Thanks
|
|
|
|
|
I am doin the following...
class ThreadTest
{
public:
ThreadTest();
void end();
DWORD WINAPI Write_data(LPVOID);
DWORD ThreadID;
void run();
private:
HANDLE hThread;
bool keepRunning;
};
ThreadTest::ThreadTest()
{
keepRunning = true;
}
void ThreadTest::run()
{
hThread = CreateThread(NULL,0,(LPTHREAD_START_ROUTINE) Write_data,NULL,0,&ThreadID);
}
void ThreadTest::end()
{
keepRunning = false;
}
DWORD WINAPI ThreadTest::Write_data(LPVOID lpParam)
{
while(keepRunning)
{
printf("I'm a thread running");
Sleep(1000);
}
return 0;
}
void main()
{
ThreadTest *t = new ThreadTest();
t->run();
Sleep(10000);
t->end();
}
On compiling I get...
error C2440: 'type cast' : cannot convert from '' to 'unsigned long (__stdcall *)(void *)'
None of the functions with this name in scope match the target type
Please help me out with this....THANKS
|
|
|
|
|
The function you pass to the CreateThread function can't be a member function of a class (the prototype is different). So, either use a non-member function or a static function.
In any case, you won't be able to access the non-static member variables. To solve this problem, pass the this pointer in the lpParameter parameter of CreateThread. It will be passed to your function and you'll be able to cast it back to your class pointer there and call a public method from there.
|
|
|
|
|
By the way, instead of using sleep, you could be much more efficient when you want to stop the thread if you use events (using CreateEvent function). When you want to stop your thread, you can signal the event. In your thread function, you can wait on the event instead of sleeping (and provide a timeout of 1000 msec) and check the return of the WaitForSingleObject to see if it is a timeout (in which case you continue your loop) or if the event has been signaled (in which case you exit your loop). This way, your thread will exit immediately and not wait until your Sleep finished.
|
|
|
|
|
I use ADO to connect to database. I connect successfully. But when I run my application with window there's an error :
Debug error :
This application has requested the Runtime to terminate it in an unusual way
Some one plz explain for me & give me a solution
|
|
|
|
|
capint wrote: This application has requested the Runtime to terminate it in an unusual way
Some one plz explain for me & give me a solution [Rose]
Please read the guidelines[^] and rephrase your question in accordance to it. With the information you've provided, I can only tell that there's "something wrong" with your code. That may not be a very helpful reply though.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
I mean that I connected successfully & I used it properly when I directly click on the application file. It just doesn't do well when start with window. Here is a part of my code. Plz help me
iSize = 0;
DateTimeNote Temp;
bool bFlag = true;
Open("Provider=Microsoft.Jet.OLEDB.4.0; \
Data Source=DateNote.mdb");
CString sql;
variant_t vNull;
variant_t TheValue;
vNull.vt = VT_ERROR;
vNull.scode = DISP_E_PARAMNOTFOUND;
CString StrResult;
CString StrSql;
CString StrDateTime;
CString StrDateTimeTemp;
StrDateTime.Format(_T("%i/%i/%i"),DateTime.GetMonth(),DateTime.GetDay(),DateTime.GetYear());
StrSql.Format(_T("SELECT * FROM DATETIMENOTE WHERE NGAY = '%s'"), StrDateTime);
m_pRecordset.CreateInstance(__uuidof(Recordset));
m_pRecordset->PutRefActiveConnection(m_pConnection);
m_pRecordset->Open(_variant_t(StrSql), vNull, adOpenForwardOnly, adLockOptimistic, adCmdText);
while (!m_pRecordset->GetEndOfFile())
{
TheValue = m_pRecordset->GetCollect("GIO");
if(TheValue.vt != VT_NULL)
{
StrResult = (char *)_bstr_t(TheValue);
StrDateTimeTemp = StrDateTime + _T(" ") + StrResult;
Temp.DateTime.ParseDateTime(StrDateTimeTemp, LOCALE_NOUSEROVERRIDE, LANG_USER_DEFAULT);
}
TheValue = m_pRecordset->GetCollect("NOTE");
if(TheValue.vt != VT_NULL)
{
StrResult = (char *)_bstr_t(TheValue);
Temp.Note = StrResult;
}
pTemp[iSize] = Temp;
iSize ++;
m_pRecordset->MoveNext();
}
|
|
|
|
|
Did you try debugging the application? Where is the crash happening?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|