|
But an administrator needs to give permissions on my .MSI. I'm deploying the component throught the internet.
I'm still hating ActiveX...
Mauricio Ritter - Brazil
Sonorking now: 100.13560 MRitter
English is not my native language so, if you find any spelling erros in my posts, please let me know.
|
|
|
|
|
Although it may be true that at some point if the machine is completely locked, it is impossible to install anything on it, usually a .msi file does work fine since it directly talks with Windows Installer which is running as a service. And the program gets installed on behalf of the Windows service.
RSS feed
|
|
|
|
|
|
Hi,everybody.
While I compiling my project writen in c++ with template ,I get a compile error c2975(vc++6.0),some error message like :
Compiling...
ChildView.cpp
..\ChildView.cpp(194) : error C2975: 'CXXTaskWorker' : invalid template argument for 'pdiid', constant expression expected
..\sbmtaskworker.h(73) : see declaration of 'CXXTaskWorker'
..\ChildView.cpp(194) : error C2975: 'CXXTaskWorker' : invalid template argument for 'plibid', constant expression expected
..\xxtaskworker.h(73) : see declaration of 'CXXTaskWorker'
..\ChildView.cpp(194) : error C2079: 'worker' uses undefined class '?$CXXTaskWorker@$1piid$1plibid'
XXTaskWorker.cpp
Error executing cl.exe.
TEST.exe - 3 error(s), 0 warning(s)
My code goes like:
//class delare
template <const IID * pdiid = &GUID_NULL,const GUID* plibid = &GUID_NULL><br />
class CXXTaskWorker : public IDispEventImpl<1, CXXTaskWorker, pdiid, plibid, 1, 0><br />
{<br />
public:<br />
...<br />
}
//use
CComponentInfo* info;<br />
if(m_mapComponent.Lookup(_T("test"),(CComponentInfo *)info))<br />
{<br />
const IID * piid = &(info->EventId);<br />
const GUID * plibid =&(info->TypeLib);<br />
<br />
CXXTaskWorker<piid, plibid> worker; <br />
... <br />
}
|
|
|
|
|
hmm, bad news for you - that would require dynamic template instantiation during the runtime. You have to realize, that the template types (piid and plibid in your cases) must be specified at compile time, that the compiler will be able to deduce the template.
e.g. the use in style
CXXTaskWorker< &IID_IUnknown, &LIBID_MyLib > worker;
is valid because compiler knows what types/constants have to use while building the template code.
while the 'same' case
<br />
const IID * piid = &(info->EventId);<br />
const GUID * plibid =&(info->TypeLib);<br />
<br />
CXXTaskWorker<piid, plibid> worker;
not being valid, because then the template parameters depends on some runtime value and this is not possible
|
|
|
|
|
Yes,that's what i am wrong.as an alternative,I can use an extern variable to handle this problem.
|
|
|
|
|
|
I'm just learning STL. I have a vector of pointers to objects of a class I created. I'm trying to use lower_bound() and upper_bound(), but I don't see any way to specify how to compare my objects...the pointers are being compared instead. Does anyone know how to do this?
Thanks-
Patti
|
|
|
|
|
I got it. There is a version of lower_bound() that takes the comparison function.
I'm not liking the STL too much, tho...
|
|
|
|
|
pfoo wrote:
I'm not liking the STL too much, tho...
It grows on you. Patience.
--
Ich, du, sie, er, es, ihr, sie, Sie.
|
|
|
|
|
Hi guys, I really wasn't sure whether or not to post this here as it might be generic to C++. Anyway, I have a WTL project.
I have some generic set up code like so...
LRESULT CMainFrame::OnCreate(...)
{
//toolbars get created here etc
lfh = new LogFileHandler();
lfh->ReadLogFile();
}
Now in the header file I have declared LogFileHandler lfh.
I have nothing yet in this class except
LogFileHandler::LogFileHandler()
{
int i = 0; //i have a breakpoint here
}
whats strange is that I get a "debug assertion failed" prompt whenever I step through the code. It tells me "m_hImageList != 0" in atlctrs.h (line 1533)
I have no idea why this happens. The app runs fine though when you hit Ctrl+F5.
Is there something I didn't pick up?
Thanks guys.
Senkwe
What's the difference between a C++ programmer and God? God knows he's not a C++ programmer :
anon
|
|
|
|
|
Sorry folks, I was caught in a bit of a brain lapse there. Figured it out.
Thanks
Senkwe
What's the difference between a C++ programmer and God? God knows he's not a C++ programmer :
anon
|
|
|
|
|
I was working on a C++ ATL server project and been using m_HttpResponse object like "cin" object to stream response back to client.
However, I can't find where this m_HttpResponse object comes from, I searched the entire handler class declaration. m_HttpResponse is nowhere to be found. And what's more interesting is that the handler class doesn't derive from anything!?? And there's no #include or#using statements at the top of the header file:
#pragma once
[ request_handler("Default") ]
class CMyHandlerClass //Derive from nothing - no inheritance observed!
{
//m_HttpResponse declaration??
};
The code works fine, just not sure why/how it worked.
norm
|
|
|
|
|
Erm, aren't all request handlers done as CRequestHandlerT< yourclass [, CComSingleThreadModel [,CHtmlTagReplacer< yourclass >]] > anyway?
That means they that yourclass doesn't need to derive from it...
Steve S
[This signature space available for rent]
|
|
|
|
|
Note this line:
norm wrote:
[ request_handler("Default") ]
From MSDN: "The request_handler attribute will usually add CRequestHandlerT as a base class. If the soap_handler attribute has been applied to this class, CSoapHandler will be added as a base class instead. If the class to which this attribute is applied already derives from IRequestHandler, then no base classes will be added."
To be honest, I don't like these attributes - they hide too much IMHO.
|
|
|
|
|
|
I understand what you've said here, however I cannot find why I constantly receive the error: error C3358: 'CSoapHandler': symbol not found
I have the code exactly like the sample OnlineAddressBook from the MSDN library yet I get the error whereas that app does not. Such simple things can stop a programmer for hours.
Here is the code I am using. Note that the Web Service this code is in compiles fine, it's when I compile the SRF (ATL Server) project that the error occurs, let me know if you need to see more code.
// DataConsumerWS.h : Defines the ATL Server request handler class
//
#pragma once
namespace DataConsumerWSService
{
const wchar_t MYDATASOURCE[] = L"Provider=SQLOLEDB.1;Persist Security Info=False;User ID=me;Initial Catalog=mine;Data Source=SERVER;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Use Encryption for Data=False;Tag with column collation when possible=False";
// all struct, enum, and typedefs for your webservice should go inside the namespace
// IDataConsumerWSService - web service interface declaration
//
[
uuid("2E179D71-E436-42EE-A1D6-00758BF3D7AA"),
object
]
__interface IDataConsumerWSService
{
// HelloWorld is a sample ATL Server web service method. It shows how to
// declare a web service method and its in-parameters and out-parameters
[id(1)] HRESULT GetStudents([out] int *arrSize,[out,size_is(*arrSize)] BSTR **NameList,[out,size_is(*arrSize)] LONG **IDList);
// TODO: Add additional web service methods here
};
// DataConsumerWSService - web service implementation
//
[
request_handler(name="Default", sdl="GenDataConsumerWSWSDL"),
soap_handler(
name="DataConsumerWSService",
namespace="urn:DataConsumerWSService",
protocol="soap"
)
]
class CDataConsumerWSService :
public IDataConsumerWSService
{
public:
// uncomment the service declaration(s) if you want to use
// a service that was generated with your ISAPI extension
CDataConnection m_dc;
HTTP_CODE InitializeHandler(AtlServerRequest *pRequestInfo, IServiceProvider *pProvider)
{
if (HTTP_SUCCESS != CSoapHandler<cdataconsumerwsservice>::InitializeHandler(pRequestInfo, pProvider))
return HTTP_FAIL;
|
|
|
|
|
Hello
I've written a logfile class that writes the logentries in xml format.
A typical usage:
mylog.WriteLog(LOG_PRIO_HIGH, "Agroup", "This is a text with %d some %s
vars", 34, "diffrent");
output
<entry date="2003-01-01" time="20:01:32:1234" prio="1"
group="Agroup">This is a text with 39 some diffrent vars
I want to accomplish the same thing by using streams/stringbuf.
But I've not found any good examples that show me how I should do.
What i've found is a couple of examples that derives a class from stringbuf and from ostream.
I would be nice of I can get something like this:
log << log_prio(1) << log_group("test") << "hello" << nIntVar << strBuf << log_end;
log << "this is a string";
log << " something more" << log_end;
log << log_prio(2) << "last line" << log_end;
would look like:
<entry date="2003-01-01" time="20:01:32:1234" prio="1" group="test">hello1yeye
<entry date="2003-01-01" time="20:01:32:2200" prio="1" group="test">this is a string something more
<entry date="2003-01-01" time="20:01:32:6600" prio="2" group="test">last line
How do I accomplish this?
Thanks,
Jonas
|
|
|
|
|
try overloading the "<<" or ">>" operators.
|
|
|
|
|
Yep. I've started to do so.
class CDtLog
{
private:
std::ostringstream m_os;
bool bNewEntry;
int m_nPrio;
char* m_szGroup[40];
public:
CDtLog()
{
bNewEntry = true;
m_nPrio = 2;
m_szGroup[0] = NULL;
}
template<class T>
CDtLog &operator<<(const T &item)
{
if (bNewEntry)
{
m_os << "<entry prio=\"" << m_nPrio << "\" ";
if (m_szGroup[0]) m_os << "group=\"" << m_szGroup << "\" ";
m_os << ">";
bNewEntry = false;
}
m_os << item ;
return *this;
};
void print()
{
printf(m_os.str().c_str());
}
};
int _tmain(int argc, _TCHAR* argv[])
{
CDtLog test;
int i = 10;
test << "hejsan" << std::setfill(' ') << std::setw(10) << 12 << i;
test.print();
return 0;
} I need a modifier that tells me that a debugentry is done, similiar to endl, but instead of just flushing, it ends the xml tag and then flush it to the file.
I also need to check every entered character to see if it's a < or >, if so I need to translate it to > or <, or it will ****up the xml.
I also want modifiers that I can use to change the prio and group.
|
|
|
|
|
I am writing an ATL component to do some data access using ATO. I want to pass a _RecordsetPtr pointer or a _ConnectionPtr to a ATL function. I use code like this:
<br />
<br />
STDMETHODIMP CMyAtlObject::ReadData(LPDISPATCH pAdoRecordset, BOOL *pbSuccess)<br />
{<br />
_RecordsetPtr pRecordsetPtr;<br />
<br />
if (FAILED(pAdoRecordset->QueryInterface(IID_IDispatch, (void**) &pRecordsetPtr)))<br />
{<br />
return S_FALSE;<br />
}<br />
<br />
<br />
<br />
<br />
return S_OK;<br />
}<br />
<br />
But this doesn't work. The recordset pointer gets closed during the function call. If I pass an _ConnectionPtr as LPDISPATCH, the pointer becomes invalid.
So how can I pass valid ADO _RecordsetPtr's and _ConnectionPtr's to an ATL Object?
|
|
|
|
|
Although I use OLE DB directly rather than ADO, unless the function explicitly requires a smart pointer, I'd be inclined to use a regular interface pointer instead, to save an AddRef and Release on construction/destruction of the temporary object.
Steve S
[This signature space available for rent]
|
|
|
|
|
|
Where does your LPDISPATCH come from in the first place? That's an IDispatch, so using QueryInterface(IID_IDISPATCH, ...) is a no-brainer, it should just AddRef().
Are you using #import to pull in the ADO stuff?
To get the recordset ptr, you should use
__uuidof(_Recordset)
in place of IID_IDISPATCH. This will either fail or fill in your _RecordsetPtr properly.
Probably need more context to help more.
Steve S
[This signature space available for rent]
|
|
|
|
|
I have a windows installer .msi file problem. I updated my Features and Components and updated the old .msi file call it old.msi into a new msi file say new.msi. When I run new.msi it calls old.msi, why is that? What have I done wrong?
I am not an expert on windows installer, please help.
Actually, I want to run an Upgrade but old.msi does not have an Upgrade table, so I am trying to do a reinstall to the upgraded product.
If this is not the right location to post this question please let me know where to post it.
Thanks,
Ann
|
|
|
|
|