|
Thank you for advise. It works, however I have another problem on ClipCursor it clips not to the picture control rectangle, but to the rectangle which has size of the picture control and it begins in the top-left corner of the screen. I guess that i have move this area over my picture control, but how to find coordinates of the top-left corner of the picture control ??
|
|
|
|
|
You need to use ScreenToClient[^].
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
while working in vc++ i am getting stuck with a small thing...
in the out put screen suppose i am getting
output line 1
output line 2
output line 3
output line 4
now i just wish to output the total output lines are 4 ???
|
|
|
|
|
Can't you just count them while they are generated ? or maybe there is a counter somewhere that sets the number of lines generated that you could use ?
This signature was proudly tested on animals.
|
|
|
|
|
You could use string::getline[^] in a loop to read the file line by line till the end of the file. In this loop you can have a counter which counts the number of lines in the file.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
How to access the registry using c language?
What is the header file I needed to do this task?
WHERE THERE IS A WILL THERE IS A WAY
-MS
|
|
|
|
|
msgreat wrote: How to access the registry using c language?
By using the Windows API Registry Functions[^]
msgreat wrote: What is the header file I needed to do this task?
You should #include Windows.h which will include Winreg.h for you. You may need to link with Advapi32.lib.
Best Wishes,
-David Delaune
|
|
|
|
|
thanks sir for the reply,
is it possible in turbo c?
Where there is a will there is a way
-MS
|
|
|
|
|
msgreat wrote: is it possible in turbo c?
Unfortunately I dont think the old TurboC 16 bit compiler will support the __stdcall calling convention[^]
Best Wishes,
-David Delaune
|
|
|
|
|
Hi,
I want to know about mouse programming.Actually i want to do is that there is a *.docx file in my computer(windows-XP)and i have a c program which can read the content of *.docx file.so first i have to give input(the location of the *.docx file) to that C program then it can read the content of that *.docx file.I want that when i click on *.docx file then it will be input for that C program.I want to ask you also that can i find file location by using mouse programming?So how can i do this???
Please help me..... Please....
Ravi Joshi
|
|
|
|
|
If, and that's a big IF, I understand correctly ...
Have a look at the topic of "file association"; google for that and you should be able to
find a lot of information on how to associate a file type/name/extension, in your case a docx file
to a particular application.
The easiest way, non-programatically, is to right-click on the docx file and choose "Open With" and
select the "Choose default program" (that's on vista, I don't have XP) and select your application.
ravi 12 wrote: I want to ask you also that can i find file location by using mouse programming?So how can i do this???
That, I don't know, what is "mouse programming" ?
This signature was proudly tested on animals.
|
|
|
|
|
Hi how can i achieve the same functionality of UrlEncodeUnicode in MFC i mean the The Unicode string in %uXXXX notation.
Thanks
|
|
|
|
|
Are you wanting something like UrlEscape() or UrlCanonicalize() ?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
David i can not make it work with Chinese chars or any other chars above 255
must i write my own UrlEncodeUnicode function?
|
|
|
|
|
Hi,
I have added the counter in a category with instance. I want to assign the value to counter and monitor this counter. I can do it same things if i do not use the instance but if i use the instance then value is not being incremented.So i would appreciate if anyone can help me.
Thanks!
Thanks
vijay
|
|
|
|
|
Hi,
im able to calculate the font height based on the give FontSize as follows...
LOGFONT lf;
int nFontSize=20;
SecureZeroMemory(&lf, sizeof(lf));
lf.lfHeight = -MulDiv(nFontSize, GetDeviceCaps(hDC, LOGPIXELSY), POINTSPERINCH);
but how can i calculate the width of the font for the give FontSize ie..
lf.lfWidth...?..
|
|
|
|
|
The width of each character in a font is different, unless it is a monospaced font.
You can use GetTextMetrics[^] to get the average width of the characters of a font.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Thanks for ur Reply...
Pls have a look over the post which i have posted just 5 hrs back...regarding
SetcolumnWidth
|
|
|
|
|
Hi,
if i debug my application, and want to close them, i receive sometimes this strange error in
void CDatabase::Close()
{
ASSERT_VALID(this);
AfxLockGlobals(CRIT_ODBC);
TRY
{
while (!m_listRecordsets.IsEmpty())
{
CRecordset* pSet = (CRecordset*)m_listRecordsets.GetHead();
pSet->Close();
pSet->m_pDatabase = NULL;
}
}
CATCH_ALL(e)
{
AfxUnlockGlobals(CRIT_ODBC);
THROW_LAST();
}
END_CATCH_ALL
AfxUnlockGlobals(CRIT_ODBC);
if (m_hdbc != SQL_NULL_HDBC)
{
RETCODE nRetCode;
AFX_SQL_SYNC(::SQLDisconnect(m_hdbc));
AFX_SQL_SYNC(::SQLFreeConnect(m_hdbc));
m_hdbc = SQL_NULL_HDBC;
_AFX_DB_STATE* pDbState = _afxDbState;
AfxLockGlobals(CRIT_ODBC);
ASSERT(pDbState->m_nAllocatedConnections != 0);
pDbState->m_nAllocatedConnections--;
AfxUnlockGlobals(CRIT_ODBC);
}
}
But the best is i dont habe any kind of database in my project included????
Does any one have a answer for this issue???
thanks for any help!
Arrin
|
|
|
|
|
Look at the call stack and you can figure out the sequence of functions that are being called.
From this you can understand how the control reached that particular function.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Hi,
thanks for answer!!
arrin
|
|
|
|
|
Hello community,
how to create a second window that is always on top of a main window,
so if i click on the main window that this pop up window stay on top until my function is finished??!?
I create a simple dialog with the resource editor and set "Set Foreground" to true,
but even if i click on the main dialog this new little dialog is in the background, how to avoid this?
If i set "Topmost" to true, than is my pop up dialog always on top, but for all other windows too,
and i like that hi is only for my main dialog in the foreground!?
Thanks for help
Arrin
EDIT: after i show my child dialog and bring him to top i disable my main dialog to make him unklickable and when my funktion is finished i enable him again,
but im not sure that this is the right way!?
dlgProgress.ShowWindow(SW_SHOW);
dlgProgress.SetForegroundWindow();
EnableWindow(FALSE);
EnableWindow(TRUE);
|
|
|
|
|
Looks like you need a modal dialog.
If you're using MFC, call CDialog::DoModal[^].
Otherwise call DialogBox[^].
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
I may have had a similar problem back several months ago. I have a modeless PropertySheet (a modeless tabbed dialog window) separate from my main Doc-View window.
I created my modeless PropertySheet window:
<br />
m_pSettings->Create(this, WS_SYSMENU | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | DS_MODALFRAME | DS_CONTEXTHELP, WS_EX_DLGMODALFRAME);<br />
m_pSettings->SetWindowPos(this,0,0,0,0,SWP_NOMOVE | SWP_NOSIZE);<br />
I do recall that there was something special to this (modeless property sheet) and the peeps here helped me out!
|
|
|
|
|
Hi,
I pushed some string values in to the STL Queue.
Now i need to pop the values from that queue using thread in MFC application.
Thanks,
Ratheesh.
|
|
|
|