|
ShellExecute(NULL, "open", "pathToYourDocFile", NULL, NULL, SW_SHOWNORMAL);
See info on parameters here: MSDN: ShellExecute[^]
|
|
|
|
|
Thanks
I used the code sent by you but it not opening the document. Below is the code
void CNUITApp::OnHelpUsermanual()
{
ShellExecute(NULL, "open", "C:\\Doc1", NULL, NULL, SW_SHOWNORMAL);
// TODO: Add your command handler code here
AfxMessageBox(_T("Feature not available gg"),MB_OK|MB_ICONINFORMATION);
}
|
|
|
|
|
Is your file really called "Doc1" ?
I suggest you use the following line:
Pre Office 2007
ShellExecute(NULL, "open", "C:\\Doc1.doc", NULL, NULL, SW_SHOWNORMAL);
or
Office 2007
ShellExecute(NULL, "open", "C:\\Doc1.docx", NULL, NULL, SW_SHOWNORMAL);
|
|
|
|
|
office 2003 is loaded in the system.
I will be giving only the exe to the customer, so we specify the path like this then we need to keep on changing the path where ever the document is copied. How to ovecome with this issue?
|
|
|
|
|
Just use a relative path.
E.g
AppFolder
|
|--FolderA
|--FolderB
\--Help
if exe is located in AppFolder, and .DOC file is in Help folder:
ShellExecute(NULL, "open", "Help\\YourFile.doc", NULL, NULL, SW_SHOWNORMAL);
if exe is located in FolderA, and .DOC file is in AppFolder:
ShellExecute(NULL, "open", "..\\YourFile.doc", NULL, NULL, SW_SHOWNORMAL);
|
|
|
|
|
Thanks u vey much
Its working
The problem was path of the file
Thanks once again
|
|
|
|
|
Pleasure.
|
|
|
|
|
Hi all,
LPMALLOC pMalloc = NULL;
LPITEMIDLIST pidl = NULL;
BROWSEINFO bi;
ZeroMemory(&bi, sizeof(BROWSEINFO));
bi.hwndOwner = m_hWnd;
bi.lpszTitle = _T("Current folder is:");
bi.ulFlags = BIF_RETURNONLYFSDIRS | BIF_STATUSTEXT;
bi.lpfn = BrowseCallbackProc;
pidl = SHBrowseForFolder(&bi);
if(pidl != NULL)
{
SHGetPathFromIDList(pidl, m_strFolderPath.GetBuffer(m_strFolderPath.GetLength()));
UpdateData(FALSE);
if(SUCCEEDED(SHGetMalloc(&pMalloc)) && pMalloc);
pMalloc->Free(pidl);
pMalloc->Release();
}
i m using this for browse for folder,the out of memory exexption occur when select any folder.
please help me for this.
thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
Why don't you release the CString buffer?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
ok , now i am using
m_strFolderPath.ReleaseBuffer();
but problem remains same.
please help me for this.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
|
thanks
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
Hi,
I'm currently using Visual Studio 2005 to build my project.
The previous code that i have was written in Visual C++ 6.0. With the current development and tools, I already convert to project by using the Visual Studio 2005.
When i compiled my code, I got this error.
openssl.lib(v3_conf.obj) : error LNK2019: unresolved external symbol __pctype referenced in function _v3_generic_extension
openssl.lib(b_print.obj) : error LNK2001: unresolved external symbol __pctype
openssl.lib(obj_dat.obj) : error LNK2001: unresolved external symbol __pctype
openssl.lib(v3_utl.obj) : error LNK2001: unresolved external symbol __pctype
openssl.lib(bn_print.obj) : error LNK2001: unresolved external symbol __pctype
openssl.lib(v3_conf.obj) : error LNK2001: unresolved external symbol ___mb_cur_max
openssl.lib(b_print.obj) : error LNK2019: unresolved external symbol ___mb_cur_max referenced in function __dopr
openssl.lib(obj_dat.obj) : error LNK2001: unresolved external symbol ___mb_cur_max
openssl.lib(v3_utl.obj) : error LNK2001: unresolved external symbol ___mb_cur_max
openssl.lib(bn_print.obj) : error LNK2001: unresolved external symbol ___mb_cur_max
openssl.lib(rsa_sign.obj) : error LNK2019: unresolved external symbol __iob referenced in function _RSA_verify
I already check from the net. And I already ignore the lib : libcmt
Is there any thing that i can do to make it compile and works?
Thanks.
|
|
|
|
|
izyani wrote: Is there any thing that i can do to make it compile and works?
You should make it link, it already compiles.
You've to add the library wherein __pctype is defined in the Additional Dependencies line of the Linker 's Input options.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi Pallini,
I already put the _pctype defined in the Additional Dependencies line of the Linker Input Option.
All error gone. But it create another error.
LINK : fatal error LNK1181: cannot open input file '_pctype.obj'
Do you have any idea?
Thanks
|
|
|
|
|
You shouldn't do that, you should add the library containing _pctype definition.
You cannot add a type as input file for the linker!
Hint for the library name: usually it has the same name the include file has (for instance, if you include, say mylibrary.h , then there are odds the library file name is mylibrary.lib ).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Check whether you have included the right "ctype.h" file in all these modules reported by your linker.
cheers
Varghese Paul
|
|
|
|
|
Erm, I dont have ctype.h in the compiler
|
|
|
|
|
hi,
i'm amble to compile.
i just change the Code generation-Run Time Library - /MTD
its work now.
thanks guys..
|
|
|
|
|
I am working on an mfc application and I am trying to load bitmap images into CRichEditCtrl Control for my chat application.
The problem with my code is that if i select only one bitmap(smiley) to send along with text it works fine but when the message contains more than one bitmap(smiley) the code gives error at LoadBitmap function call at some Attach function.
Please tell me how to resolve it.
Thanks In Advance.
|
|
|
|
|
No code => no help.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I am sending you the code
void CChatDlg::InternalAppendTextinRichEdit(LPCTSTR szText)
{
int len;
ASSERT(szText);
ASSERT(AfxIsValidString(szText));
CWnd * pWnd = (CWnd*) GetDlgItem(IDC_TRANSCRIPT);
CString strToInsert = szText;
strToInsert.MakeLower();
CString strTemp = g_ChatManager.GetCurrentCSR();
strTemp.MakeLower();
COLORREF color;
if(0 == strToInsert.Find(strTemp))
{
color = RGB(185,0,0);
}
else if(-1 != strToInsert.Find(_T(":")))
{
int n = strToInsert.Find(_T("notice"));
if(0 == n)
{
color = RGB(0,128,0);
CString str1 = _T("notice:now user has join the chat");
if(0==strToInsert.Find(str1))
{
CheckVisitorNameandMail();
}
}
else
{
color = RGB(0,0,255);
SetDlgItemText(IDC_STATIC_STATUS,_T(""));
}
}
else
{
color = RGB(0,128,0);
}
CString strText = szText;
CString strtemp = szText;
CString strFinal;
int first=0,start,end,last,length;
if((strToInsert.Find('[',0)>=0))
{
m_cfDefault.crTextColor = color;
m_richEdit.SetSelectionCharFormat(m_cfDefault);
int option = 0 ;
CWnd *focusWnd = GetFocus();
int iTotalTextLength = m_richEdit.GetWindowTextLength();
while(strText.GetLength()>0)
{
CBitmap m_bitmap;
first = 0;
length = strText.GetLength();
if(strText.Find(_T("[:)]"),first)>=0)
{
option = 1;
start = strText.Find(_T("[:)]"),first);
}
else if(strText.Find(_T("[:D]"),first)>=0)
{
option = 2;
start = strText.Find(_T("[:D]"),first);
}
if(option == 1)
{
end = start + 3;
CString f = strText.Mid(first,start);
if(f!=_T(""))
m_richEdit.ReplaceSel(f);
CString e = strtemp.Mid(end+1,length);
m_bitmap.LoadBitmap(MAKEINTRESOURCE(IDB_HAPPY));
InsertPlotBitmap((HBITMAP)m_bitmap);
delete(m_bitmap);
strFinal = e ;
strText = strFinal;
strtemp = strFinal;
}
else if(option == 2)
{
end = start + 3;
CString f = strText.Mid(first,start);
if(f!=_T(""))
m_richEdit.ReplaceSel(f);
CString e = strtemp.Mid(end+1,length);
m_bitmap.LoadBitmap(MAKEINTRESOURCE(IDB_BIGGRIN));
InsertPlotBitmap((HBITMAP)m_bitmap);
delete(m_bitmap);
strFinal = e ;
strText = strFinal;
strtemp = strFinal;
}
else
{
m_richEdit.ReplaceSel(strText);
strText = _T("");
}
}
}
Thanks
|
|
|
|
|
Dhiraj kumar Saini wrote: delete(m_bitmap);
What is the rationale behind the above? You're deleting a variable that isn't even a pointer.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
My problem got solved. I had to use DeleteObject function.
Thanx for the help.
|
|
|
|
|
Hi all,
Does anyone of you know how I can change the cursor type of the text editor in Visual Studio 2005?
This tiny cursor drives me crazy
Thank you.
modified 7-Mar-17 12:13pm.
|
|
|
|