|
Look for a sample at CP. You got to import the COM-libs of excel and instanciate an Excel COM Object and do the stuff.
Greetings from Germany
|
|
|
|
|
Dear Sir,
I learn my self, I am still a beginer.
CAn you show me exactly or give me example so i can understand.
I am waitting your clear example
|
|
|
|
|
On top of the webpage there is the search box. Enter "excel" and Go! and you find a lot.
Thats what I have done and I think this article could fit best for your needs:
http://www.codeproject.com/wtl/WTLExcel.asp[^]
Greetings from Germany
|
|
|
|
|
|
mikobi wrote: How can I open excel file(i.e c:\gestion\Payroll.xls) from my Visual c++ 6.0 program
Are you referring to ShellExecute() ?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
See What I write without success;
ShellExecute(this->m_hWnd,"open","c:\gestion\payroll.xls","","", SW_SHOW );
|
|
|
|
|
mikobi wrote: ShellExecute(this->m_hWnd,"open","c:\gestion\payroll.xls","","", SW_SHOW );
While you failed to explain what "without success" means, I can only assume it should be:
ShellExecute(this->m_hWnd, "open", "c:\\gestion\\payroll.xls", "", NULL, SW_SHOW);
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi everybody. Good morning.
I´d like to know what is the precompiled header for, why is ti useful, and what are the differences between Selecting "Not using precompiled headers" or using stdafx.h
I´m getting an error message when building on Release version, something like this :
Fatal error C1083: Cannot open precompiled header file: 'Release/TMB.pch': No such file or directory
I can fix that by selecting Not using precompiled headers, but I want to know why it happens.
Thanks!
Time to come clean...
Vive y deja vivir / Live and let live
Javier
|
|
|
|
|
PCHs do pretty much what they say on the tin. Ususally in the MSVC context your PCH is built from stdafx.h . This means the compiler takes stdafx.h and everything it #include s and compiles it first into a special 'pre-compiled' bunch of stuff it puts in the .pch file. Then when it sees #include "stdafx.h" in some other .cpp file later on it doesn't have to go through stdafx.h and all its included headers again it just links in the pre-compiled stuff from the .pch file it created before. Essentially it's a way of speeding up your builds.
I don't know exactly why you're seeing this error but what it means is the .pch file has not been built for your Release build. If your settings are consistent. i.e. each .cpp is set correctly to use or not use a .pch and all the ones that use it generate it from the same header, then a full Rebuild should fix this. Sometimes the incremental linker gets confused and thinks the .pch has been built when it hasn't after something is changed that requires it to be rebuilt.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Please refer here[^].
Regards,
Paresh.
|
|
|
|
|
Hi all,
I m trying to make an application in which i have to list out all the machines in the LAN that has oracle server running. and list of all the databases on a perticular machine.
I did same kind of thing with SQL Server using "sqldmo.dll".
If anyone can help me out in doing this or suggest me some dll using which i can do the same.
Thank You
Regards,
Pankaj Sachdeva
|
|
|
|
|
Can't you just query for Oracle-related services on those machines?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi All
I am creating customize tooltip control in which i want to know that how we can check that mouse move on particular button on ToolBar so that particular Tooltip will display.
Thanks and Regards
Atul
|
|
|
|
|
Will CWnd::OnNcHitTest serve your purpose ?
Regards,
Paresh.
|
|
|
|
|
I add a Static Text control in a form. Now I want to change its text's color to Green.Could somebody give me some advice?
Thanks in advance.
Peter.
|
|
|
|
|
Maybe you want to use of this message WM_CTLCOLORSTATIC and on the this message use of SetTextColor(); for color and SetBkColor() for background.
|
|
|
|
|
I finally find the right function. I should use SetTextColor. Now I works. Thanks for your reminding.
Peter.
|
|
|
|
|
|
Hi,
I have generated a webservice proxy code in c++ using SPROXY.exe tool.
Using this proxy code I call to webservice methods (written in Java). I can call the methods now but I am not able to send the authentication (username/pwd) information and hence the web service responds with error stating “Failed Authentication”.
How can I modify my proxy code so that I can send the authentication information in the SOAP header?
Proxy class code:
#pragma once
#if !defined(_WIN32_WINDOWS) && !defined(_WIN32_WINNT) && !defined(_WIN32_WCE)
#pragma message("warning: defining _WIN32_WINDOWS = 0x0410")
#define _WIN32_WINDOWS 0x0410
#endif
#include <atlsoap.h>
namespace GetTradesByCLRefIDService
{
template <typename TClient = CSoapSocketClientT<> >
class CGetTradesByCLRefIDServiceT :
public TClient,
public CSoapRootHandler
{
protected:
const _soapmap ** GetFunctionMap();
const _soapmap ** GetHeaderMap();
void * GetHeaderValue();
const wchar_t * GetNamespaceUri();
const char * GetServiceName();
const char * GetNamespaceUriA();
HRESULT CallFunction(
void *pvParam,
const wchar_t *wszLocalName, int cchLocalName,
size_t nItem);
HRESULT GetClientReader(ISAXXMLReader **ppReader);
public:
HRESULT __stdcall QueryInterface(REFIID riid, void **ppv)
{
if (ppv == NULL)
{
return E_POINTER;
}
*ppv = NULL;
if (InlineIsEqualGUID(riid, IID_IUnknown) ||
InlineIsEqualGUID(riid, IID_ISAXContentHandler))
{
*ppv = static_cast<ISAXContentHandler *>(this);
return S_OK;
}
return E_NOINTERFACE;
}
ULONG __stdcall AddRef()
{
return 1;
}
ULONG __stdcall Release()
{
return 1;
}
CGetTradesByCLRefIDServiceT(ISAXXMLReader *pReader = NULL)
:TClient(_T("http://someurl"))
{
SetClient(true);
SetReader(pReader);
}
~CGetTradesByCLRefIDServiceT()
{
Uninitialize();
}
void Uninitialize()
{
UninitializeSOAP();
}
HRESULT getTradeExecutionReportByClOrdID(
BSTR companyName,
BSTR userName,
BSTR clOrdID,
BSTR* __retval
);
};
typedef CGetTradesByCLRefIDServiceT<> CGetTradesByCLRefIDService;
struct __CGetTradesByCLRefIDService_getTradeExecutionReportByClOrdID_struct
{
BSTR companyName;
BSTR userName;
BSTR clOrdID;
BSTR __retval;
};
extern __declspec(selectany) const _soapmapentry __CGetTradesByCLRefIDService_getTradeExecutionReportByClOrdID_entries[] =
{
{
0x7D5AC538,
"companyName",
L"companyName",
sizeof("companyName")-1,
SOAPTYPE_STRING,
SOAPFLAG_NONE | SOAPFLAG_IN | SOAPFLAG_RPC | SOAPFLAG_ENCODED | SOAPFLAG_NULLABLE,
offsetof(__CGetTradesByCLRefIDService_getTradeExecutionReportByClOrdID_struct, companyName),
NULL,
NULL,
-1,
},
{
0x8253F720,
"userName",
L"userName",
sizeof("userName")-1,
SOAPTYPE_STRING,
SOAPFLAG_NONE | SOAPFLAG_IN | SOAPFLAG_RPC | SOAPFLAG_ENCODED | SOAPFLAG_NULLABLE,
offsetof(__CGetTradesByCLRefIDService_getTradeExecutionReportByClOrdID_struct, userName),
NULL,
NULL,
-1,
},
{
0xC68868A1,
"clOrdID",
L"clOrdID",
sizeof("clOrdID")-1,
SOAPTYPE_STRING,
SOAPFLAG_NONE | SOAPFLAG_IN | SOAPFLAG_RPC | SOAPFLAG_ENCODED | SOAPFLAG_NULLABLE,
offsetof(__CGetTradesByCLRefIDService_getTradeExecutionReportByClOrdID_struct, clOrdID),
NULL,
NULL,
-1,
},
{
0x11515F60,
"return",
L"return",
sizeof("return")-1,
SOAPTYPE_STRING,
SOAPFLAG_NONE | SOAPFLAG_OUT | SOAPFLAG_RPC | SOAPFLAG_ENCODED | SOAPFLAG_NULLABLE,
offsetof(__CGetTradesByCLRefIDService_getTradeExecutionReportByClOrdID_struct, __retval),
NULL,
NULL,
-1,
},
{ 0x00000000 }
};
extern __declspec(selectany) const _soapmap __CGetTradesByCLRefIDService_getTradeExecutionReportByClOrdID_map =
{
0x311696DC,
"getTradeExecutionReportByClOrdID",
L"getTradeExecutionReportByClOrdID",
sizeof("getTradeExecutionReportByClOrdID")-1,
sizeof("getTradeExecutionReportByClOrdID")-1,
SOAPMAP_FUNC,
__CGetTradesByCLRefIDService_getTradeExecutionReportByClOrdID_entries,
sizeof(__CGetTradesByCLRefIDService_getTradeExecutionReportByClOrdID_struct),
1,
-1,
SOAPFLAG_NONE | SOAPFLAG_RPC | SOAPFLAG_ENCODED,
0x17BF4332,
"http://someurl",
L"http://someurl",
sizeof("http://someurl")-1
};
extern __declspec(selectany) const _soapmap * __CGetTradesByCLRefIDService_funcs[] =
{
&__CGetTradesByCLRefIDService_getTradeExecutionReportByClOrdID_map,
NULL
};
template <typename TClient>
inline HRESULT CGetTradesByCLRefIDServiceT<TClient>::getTradeExecutionReportByClOrdID(
BSTR companyName,
BSTR userName,
BSTR clOrdID,
BSTR* __retval
)
{
if ( __retval == NULL )
return E_POINTER;
HRESULT __atlsoap_hr = InitializeSOAP(NULL);
if (FAILED(__atlsoap_hr))
{
SetClientError(SOAPCLIENT_INITIALIZE_ERROR);
return __atlsoap_hr;
}
CleanupClient();
CComPtr<IStream> __atlsoap_spReadStream;
__CGetTradesByCLRefIDService_getTradeExecutionReportByClOrdID_struct __params;
memset(&__params, 0x00, sizeof(__params));
__params.companyName = companyName;
__params.userName = userName;
__params.clOrdID = clOrdID;
__atlsoap_hr = SetClientStruct(&__params, 0);
if (FAILED(__atlsoap_hr))
{
SetClientError(SOAPCLIENT_OUTOFMEMORY);
goto __skip_cleanup;
}
__atlsoap_hr = GenerateResponse(GetWriteStream());
if (FAILED(__atlsoap_hr))
{
SetClientError(SOAPCLIENT_GENERATE_ERROR);
goto __skip_cleanup;
}
__atlsoap_hr = SendRequest(_T("SOAPAction: \"\"\r\n"));
if (FAILED(__atlsoap_hr))
{
goto __skip_cleanup;
}
__atlsoap_hr = GetReadStream(&__atlsoap_spReadStream);
if (FAILED(__atlsoap_hr))
{
SetClientError(SOAPCLIENT_READ_ERROR);
goto __skip_cleanup;
}
// cleanup any in/out-params and out-headers from previous calls
Cleanup();
__atlsoap_hr = BeginParse(__atlsoap_spReadStream);
if (FAILED(__atlsoap_hr))
{
SetClientError(SOAPCLIENT_PARSE_ERROR);
goto __cleanup;
}
*__retval = __params.__retval;
goto __skip_cleanup;
__cleanup:
Cleanup();
__skip_cleanup:
ResetClientState(true);
memset(&__params, 0x00, sizeof(__params));
return __atlsoap_hr;
}
template <typename TClient>
ATL_NOINLINE inline const _soapmap ** CGetTradesByCLRefIDServiceT<TClient>::GetFunctionMap()
{
return __CGetTradesByCLRefIDService_funcs;
}
template <typename TClient>
ATL_NOINLINE inline const _soapmap ** CGetTradesByCLRefIDServiceT<TClient>::GetHeaderMap()
{
static const _soapmapentry __CGetTradesByCLRefIDService_getTradeExecutionReportByClOrdID_atlsoapheader_entries[] =
{
{ 0x00000000 }
};
static const _soapmap __CGetTradesByCLRefIDService_getTradeExecutionReportByClOrdID_atlsoapheader_map =
{
0x311696DC,
"getTradeExecutionReportByClOrdID",
L"getTradeExecutionReportByClOrdID",
sizeof("getTradeExecutionReportByClOrdID")-1,
sizeof("getTradeExecutionReportByClOrdID")-1,
SOAPMAP_HEADER,
__CGetTradesByCLRefIDService_getTradeExecutionReportByClOrdID_atlsoapheader_entries,
0,
0,
-1,
SOAPFLAG_NONE | SOAPFLAG_RPC | SOAPFLAG_ENCODED,
0x17BF4332,
"http://someurl",
L"http://someurl",
sizeof("http://someurl")-1
};
static const _soapmap * __CGetTradesByCLRefIDService_headers[] =
{
&__CGetTradesByCLRefIDService_getTradeExecutionReportByClOrdID_atlsoapheader_map,
NULL
};
return __CGetTradesByCLRefIDService_headers;
}
template <typename TClient>
ATL_NOINLINE inline void * CGetTradesByCLRefIDServiceT<TClient>::GetHeaderValue()
{
return this;
}
template <typename TClient>
ATL_NOINLINE inline const wchar_t * CGetTradesByCLRefIDServiceT<TClient>::GetNamespaceUri()
{
return L"http://someurl";
}
template <typename TClient>
ATL_NOINLINE inline const char * CGetTradesByCLRefIDServiceT<TClient>::GetServiceName()
{
return NULL;
}
template <typename TClient>
ATL_NOINLINE inline const char * CGetTradesByCLRefIDServiceT<TClient>::GetNamespaceUriA()
{
return "http://someurl";
}
template <typename TClient>
ATL_NOINLINE inline HRESULT CGetTradesByCLRefIDServiceT<TClient>::CallFunction(
void *,
const wchar_t *, int,
size_t)
{
return E_NOTIMPL;
}
template <typename TClient>
ATL_NOINLINE inline HRESULT CGetTradesByCLRefIDServiceT<TClient>::GetClientReader(ISAXXMLReader **ppReader)
{
if (ppReader == NULL)
{
return E_INVALIDARG;
}
CComPtr<ISAXXMLReader> spReader = GetReader();
if (spReader.p != NULL)
{
*ppReader = spReader.Detach();
return S_OK;
}
return TClient::GetClientReader(ppReader);
}
} // namespace GetTradesByCLRefIDService
Code: webservice client
using namespace GetTradesByCLRefIDService;
GetTradesByCLRefIDService::CGetTradesByCLRefIDService service;
//HRESULT hr = service.getTradeExecutionReportByClOrdID("","","","");
//GetTradesByCLRefIDService::String str;
BSTR str;
//str.resp = CComBSTR(L"AlexDemoCO");
HRESULT hr = service.getTradeExecutionReportByClOrdID(companyname,username,ClOrdId,&str);
cout << sizeof(str);
if (FAILED(hr))
{
cout <<" fail to call";
//cout << L"0x" << hr;
//std::wcout << L"0x" << std::hex << hr;
//cout << (char *)str;
cout << sizeof(str);
return hr;
}
// cout << (char *)str;
std::wcout << static_cast<const wchar_t*> (str);
cout << "Web Service Called:Success";
cout << sizeof(str);
Regards
|
|
|
|
|
I Created a list view and modified the style with LVS_EX_CHECKBOXES, and the checkbox is created, but there is no image where the checkbox should be, only a blank space.
Here's part of the code:
<br />
<br />
<br />
CAPPRESULT CListViewCtrl::Create(HWND pHWndParentS_, int nWndID_, CWnd::SCWndConf* pConfDataS)<br />
{<br />
<br />
CAPPRESULT sRes;<br />
<br />
if(CAPP_FAILED(sRes = CCtrl::Create(pHWndParentS_, nWndID_, pConfDataS)))<br />
{<br />
<br />
return sRes;<br />
<br />
}
<br />
WNDCLASSEX WindowClassS;<br />
<br />
if(CWndMgr::GetInstance().InsertRegisteredClassName("CListViewCtrl", FALSE))<br />
{<br />
<br />
INITCOMMONCONTROLSEX InitCommCtrlS = {0};<br />
InitCommCtrlS.dwSize = sizeof(INITCOMMONCONTROLSEX);<br />
InitCommCtrlS.dwICC = ICC_TREEVIEW_CLASSES;<br />
InitCommonControlsEx(&InitCommCtrlS);<br />
<br />
}
<br />
DWORD ulStyle, ulExStyle;<br />
<br />
if(static_cast<CListViewCtrl::SCListViewCtrlConf*>(pConfDataS)->m_bEditLabel)<br />
{<br />
<br />
ulStyle = WS_TABSTOP | WS_CHILD | WS_VISIBLE | LVS_AUTOARRANGE | LVS_REPORT | LVS_OWNERDATA | LVS_EDITLABELS;<br />
<br />
}else<br />
{<br />
<br />
ulStyle = WS_TABSTOP | WS_CHILD | WS_VISIBLE | LVS_AUTOARRANGE | LVS_REPORT | LVS_OWNERDATA;<br />
<br />
}
<br />
HWND pHWndS;<br />
<br />
if(static_cast<CListViewCtrl::SCListViewCtrlConf*>(pConfDataS)->m_bNoBorder)<br />
{<br />
<br />
ulExStyle = NULL;<br />
<br />
}else<br />
{<br />
<br />
ulExStyle = WS_EX_CLIENTEDGE;<br />
<br />
}
<br />
if(CAPP_FAILED(sRes = this->CreateEx(ulExStyle, WC_LISTVIEW, "", ulStyle,<br />
0,0,0,0, pHWndParentS_, (HMENU) (int) nWndID_, NULL, &pHWndS)))<br />
{<br />
<br />
return sRes;<br />
<br />
}
<br />
<br />
this->m_unIconID = static_cast<CListViewCtrl::SCListViewCtrlConf*>(pConfDataS)->m_unIconID;<br />
<br />
if(CAPP_FAILED(sRes = (this->OnCreate(pHWndS, nWndID_))))<br />
{<br />
<br />
return sRes;<br />
<br />
}
<br />
return CAPP_ERR_NO_ERRORS;<br />
<br />
}
<br />
<br />
<br />
<br />
CAPPRESULT CListViewCtrl::SetExtendedStyleEx(DWORD ulExMask_, DWORD ulExStyle_)<br />
{<br />
<br />
CAPPRESULT sRes;<br />
<br />
HWND pHWndS;<br />
<br />
if(CAPP_FAILED(sRes = this->GetHWnd(&pHWndS)))<br />
{<br />
<br />
return sRes;<br />
<br />
}
<br />
ListView_SetExtendedListViewStyleEx(pHWndS, ulExMask_, ulExStyle_);<br />
<br />
<br />
return CAPP_ERR_NO_ERRORS;<br />
<br />
}
<br />
<br />
<br />
<br />
<br />
Please if anybody has any clue as to what might be happening let me know.
I aoplogize if the OO library that I'm using, which is my own, can be a bit confusing, but it's basically the same Win32.
|
|
|
|
|
When I tried to run my Dialog based application .. i Got the error message - Failed to create empty Document...
Why is it so
Proud To Be an Indian
|
|
|
|
|
vivekphlp wrote: When I tried to run my Dialog based application
Are you sure that it's dialog based? That message usually only is seen for SDI or MDI apps.
|
|
|
|
|
oops sorry its an SDI appln only...
Proud To Be an Indian
|
|
|
|
|
Hi,
I think some where near your View creation fails.
Check for OnCreate,... return -1;
This happens when the document is created with no views.
Best Regards
Raj
|
|
|
|
|
yes -1 is returned .
but i dont understand that how no view is created...
Proud To Be an Indian
|
|
|
|
|