|
Go to Project | Settings | Link | Object/library modules, and add Vfw32.lib.
HPS HwndSpy - GUI developer's aid to visually
locate and inspect windows. For the month of August
only, use coupon code CP-81239 for 30% off.
|
|
|
|
|
thanks
it helped,
but i can't launch AVIStreamOpenFromFile even if i close the directshow's capture graph, i don't understand why
any idea ??
|
|
|
|
|
Hi All,
I Want to use the newwindow event to not open the new window and open the
same link in parent window...I have declared the function like this..
DISP_FUNCTION_ID(CWebBrowser2, "NewWindow2",DISPID_NEWWINDOW2, OnNewWindow,
VT_EMPTY, VTS_BSTR VTS_I4 VTS_BSTR VTS_PVARIANT VTS_BSTR VTS_PBOOL)
and the function definition says..
void CBrowser::OnNewWindow(BSTR URL, long Flags, BSTR TargetFrameName,
VARIANT* PostData, BSTR Headers, BOOL FAR* Cancel)
{
if (m_pBrowserApp) {
COleVariant varEmpty;
if (Cancel != NULL )
*Cancel = TRUE;
m_pBrowserApp->Navigate(URL, &varEmpty, &varEmpty, &varEmpty, &varEmpty);
}
}
MSDN says it should work like this only..but unfortunately this is not
working for me..Pls helpAny help or pointers are higly appreciated..Thanks a
lot in advance..
Himanshu
|
|
|
|
|
Hi,
I've build an application with some documentation (in an Adobe PDF format), and I must build a button in my app to show this documentation.
Do you know wether I can open this file from my own program (please add some sample code, using "help.pdf", or something like it), if this isn't possible, can I do it with ms word (doc format help).
Thank you in advance,
Boudewijn
|
|
|
|
|
Use ShellExecute() :
ShellExecute(m_hWnd, "open", "help.pdf", NULL, NULL, SW_SHOW);
This assumes that Acrobat is installed.
HPS HwndSpy - GUI developer's aid to visually
locate and inspect windows. For the month of August
only, use coupon code CP-81239 for 30% off.
|
|
|
|
|
Hi,
I need to have some kind of control to select a directory, just like a file:
There must be some kind of dialog, like an openFileDialog, wich can select directories, instead of jsut files.
Does anyone know wether there is such a control, and where can I find it in MFC?
Thank you in advance,
Boudewijn
|
|
|
|
|
SHBrowseForFolder
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
Hi,
thanks for helping, but I don't understand how to get a BROWSEINFO structure, can you give a hint (or the solution)?
Thank you,
|
|
|
|
|
The MSDN documentation has plenty of examples:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/functions/shbrowseforfolder.asp
|
|
|
|
|
http://www.codeproject.com/useritems/browse_for_folder_part_2.asp?target=folder%7Cbrows
Yes,Free Code project~~~~
|
|
|
|
|
I need special log/history window control where the first line that is entered appears at the bottom, and the contents are scrolled upwards. (Like in mIRC). And it must be able to select the text. Maybe there is a way to modify CEdit class?
|
|
|
|
|
void EnsureVisible()
{
// The pointer to my edit.
extern CEdit* pmyEdit;
int nLines = pmyEdit->GetLineCount();
// Scroll the edit control so that the first visible line
// is the last line of text.
if (nLines > 0)
{
pmyEdit->LineScroll(nLines+1, 0);
}
}
Then,you can call this function so that the last line is always visible.
Yes,Free Code project~~~~
|
|
|
|
|
Thanks for scrolling, but i need the first line to be displayed at the bottom of CEdit. Imagine empty Edit control. Then i call some AddLine(...) function and this line appears at the bottom (not at the top like CEDit does). The second line moves first one upward and so on.
Generally i need something like this
http://www.codeguru.com/controls/output_window.shtml
but with ability to select text
|
|
|
|
|
Derive CMyEdit from CEdit. Add this method to CMyEdit:
void CMyEdit::Insert(LPCTSTR lpszText)
{
SetSel(0, 0);
ReplaceSel(lpszText);
}
Add lines to edit box like this:
CMyEdit m_edit;
.
.
.
for (int n = 0; n < 100; n++)
{
CString str;
str.Format("This is line %d\r\n", n);
m_edit.Insert(str);
}
Note: in Resource Editor, make sure edit box has styles multiline, vertical scroll, and auto vscroll.
HPS HwndSpy - GUI developer's aid to visually
locate and inspect windows. For the month of August
only, use coupon code CP-81239 for 30% off.
|
|
|
|
|
HPSI have done it.
May be, you need the first line is always visible.
void EnsureVisible()
{
// The pointer to my edit.
CMyEdit m_edit;
int nFirstVisible = m_edit.GetFirstVisibleLine();
// Scroll the edit control so that the first visible line
// is the last line of text.
if (nFirstVisible > 0)
{
m_edit.LineScroll(-nFirstVisible, 0);
}
}
Yes,Free Code project~~~~
|
|
|
|
|
hello,
I want to send a pointer from my VB client app. to a VC dll the code is :
for VB
-------
Private Declare Sub GenerateReport Lib "Generator.dll" (ByVal datele As ADODB.Recordset)
Private Sub Command1_Click()
Dim con As ADODB.Connection
Dim rs As ADODB.Recordset
c = "PROVIDER=sqloledb;server=romulus;uid=sa;pwd=951;DataBase=SindServLast"
Set con = New ADODB.Connection
con.Open c
Dim s As String
s = "select * from T_USR_Useri"
Set rs = con.Execute(s)
GenerateReport rs
End Sub
fot VC dll
-----------
void GenerateReport(_RecordsetPtr pRs)
{
pRs->MoveFirst();
CString text;
text=(char*)((_bstr_t)pRs->Fields->GetItem((_variant_t)("usr_LoginName"))->Value);
}
and everything works fine in vc ... the pointer is recived correctly and the text CString is filled ok but after that when my c++ function ends and the execution returns to VB the VB client crushes ... and raise an access violation error ..
why ?
thanks !!!!!
|
|
|
|
|
Perhaps you should be use "_RecordsetPtr* pRs".
Try it,then you could be success.
Yes,Free Code project~~~~
|
|
|
|
|
suncho wrote:
Perhaps you should be use "_RecordsetPtr* pRs".
I doubt it. _RecordsetPtr is a smart pointer. Nevertheless, he could try it. You have no idea how many times I am wrong.
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
this is a way, yes, use a pointer's pointer.
In fact, i doubt it too, but should be try.
Yes,Free Code project~~~~
|
|
|
|
|
if I use _RecordsetPtr *pRs it will get me compiler errors ... _RecordsetPtr it is already a pointer ... and his sizeof is 4
|
|
|
|
|
Hi,
I would like to convert a hexadecimal value to decimal. is there any method in C++ available for me to do that??
For example :
The hexadecimal value of '5a' should be converted to 90 in decimal.
Thanks.
|
|
|
|
|
long lVal = 0x5a;
Yes,Free Code project~~~~
|
|
|
|
|
Given a hex value as a string representation, you could use
strtol or _tcstol to convert using a given base. In your case, this would be 16.
something like:
TCHAR czHex[] = _T("5a");<br />
TCHAR* pzStop = NULL;<br />
long nValue;<br><br />
nValue = _tcstol(czHex, &pzStop, 16);<br />
std::wcout<<_T("Hex Value: ")<<czHex<<_T(" equals: ")<<nValue<<std::endl;<br />
should to the trick. I'm sure there are other ways.
"..Even my comments have bugs!"
Inspired by Toni78
|
|
|
|
|
RChin wrote:
"..Even my comments have bugs!"
Inspired by Toni78
I had no idea that I inspired you! Thank you for noticing my signature.
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
How I control the size of a window meta file when paste it?
example:
//write a WMF and put it into the clipboard.
void copy()
{
CMetaFileDC * m_pMetaDC = new CMetaFileDC();
CRect rc(0,0,20000,20000);
m_pMetaDC->CreateEnhanced(GetDC(),_T ("c:\\test.wmf"),&rc,"name");
//drawing the lines in the DC.....
HENHMETAFILE hMF= m_pMetaDC->CloseEnhanced();
//copy to the clipboard
OpenClipboard();
EmptyClipboard();
::SetClipboardData(CF_ENHMETAFILE,hMF);
CloseClipboard();
}
//then paste the file in a CRichEditView.
void CMyView::PasteIt()
{
GetRichEditCtrl()->Paste();
//clear the clipboard
OpenClipboard();
EmptyClipboard();
CloseClipboard();
}
In windows2000, I can control the size of the metafile with the third parameter of the function CreateEnhanced.But in Win98, the parameter have no function. Why? How control the size in win98?
Thanks a lot.
Yes,Free Code project~~~~
|
|
|
|