|
Hi,
I would like to create a program that scans the outgoing and
incoming mails like Norton AntiVirus. From my searches I think Norton acts like SMTP+POP3 proxy. Norton does not want its users to change the server settings of their email clients to localhost to work with Norton mail scanning ( a kind of handfree approach). Can we create such a program.
So my idea is that a program that acts as a bridge between "actual mail client" and the email client and captures the incoming and outgoing mail and process those mails (virus scanning with clamav database).
Please help.........
|
|
|
|
|
Sir,
i have a datagrid containing customer order details.i want to display it in microsoft word using automation.give me some ideas or clues
|
|
|
|
|
Hi, folks,
I am writing a database access code in VC++6 using the row OLEDB interfaces, using SQLOLEDB 2.0 and connecting SQL server 2000. Running into a problem with inserting with client cursor. I found once the client cursor is on, the rowset always gets one more column than what are in the table. (which is obviously used by client cursor engine). The question is: with this extra column, how can i possibly do insert? I tried through ADO and still use SQLOLEDB on background, it is fine. I don't know how ADO solves this problem.
By the way, update and delete is fine, which is reasonable.
pIRowsetChange->DeleteRows(...) -->fine
pIRowsetChange->SetData(...) -->fine
pIRowsetChange->InsertRow(...) -->no good! error is like:
DBSTATUS_E_BADSTATUS.. DBSTATUS_E_UNAVAILABLE
Any idea?
Jason D.
Jason D.
|
|
|
|
|
What rowset options are you requesting/getting?
I've used the ATL wrappers extensively, and not have any real problems (apart from the obvious ones, like autoincrement issues)
Steve S
Developer for hire
|
|
|
|
|
Hi, Steve,
Thanks for response. I am using the following combination. Actually DBPROP_CLIENTCURSOR is not necessary, since DBPROP_IRowsetLocate acquires client cursor automatically. Any way, I have tried other combinations, like just clientcursor nothing else. As long as I turn client cursor on, inserting alway fails.
Properties[0].colid = DB_NULLID;
Properties[0].dwOptions = DBPROPOPTIONS_REQUIRED;
Properties[0].dwPropertyID = DBPROP_IRowsetLocate;
V_VT(&Properties[0].vValue) = VT_BOOL;
V_BOOL(&Properties[0].vValue) = VARIANT_TRUE;
Properties[1].colid = DB_NULLID;
Properties[1].dwOptions = DBPROPOPTIONS_REQUIRED;
Properties[1].dwPropertyID = DBPROP_IRowsetUpdate;
V_VT(&Properties[1].vValue) = VT_BOOL;
V_BOOL(&Properties[1].vValue) = VARIANT_TRUE;
Properties[2].colid = DB_NULLID;
Properties[2].dwOptions = DBPROPOPTIONS_REQUIRED;
Properties[2].dwPropertyID = DBPROP_CANHOLDROWS;
V_VT(&Properties[2].vValue) = VT_BOOL;
V_BOOL(&Properties[2].vValue) = VARIANT_TRUE;
Properties[3].colid = DB_NULLID;
Properties[3].dwOptions = DBPROPOPTIONS_REQUIRED;
Properties[3].dwPropertyID = DBPROP_RETURNPENDINGINSERTS;
V_VT(&Properties[3].vValue) = VT_BOOL;
V_BOOL(&Properties[3].vValue) = VARIANT_TRUE;
Properties[4].colid = DB_NULLID;
Properties[4].dwOptions = DBPROPOPTIONS_REQUIRED;
Properties[4].dwPropertyID = DBPROP_IRowsetRefresh;
V_VT(&Properties[4].vValue) = VT_BOOL;
V_BOOL(&Properties[4].vValue) = VARIANT_TRUE;
Properties[5].colid = DB_NULLID;
Properties[5].dwOptions = DBPROPOPTIONS_REQUIRED;
Properties[5].dwPropertyID = DBPROP_UPDATABILITY;
V_VT(&Properties[5].vValue) = VT_I4;
V_I4(&Properties[5].vValue) = DBPROPVAL_UP_CHANGE | DBPROPVAL_UP_DELETE | DBPROPVAL_UP_INSERT;
Properties[6].colid = DB_NULLID;
Properties[6].dwOptions = DBPROPOPTIONS_REQUIRED;
Properties[6].dwPropertyID = DBPROP_IRowsetChange;
V_VT(&Properties[6].vValue) = VT_BOOL;
V_BOOL(&Properties[6].vValue) = VARIANT_TRUE;
Properties[7].colid = DB_NULLID;
Properties[7].dwOptions = DBPROPOPTIONS_REQUIRED;
Properties[7].dwPropertyID = DBPROP_COLUMNRESTRICT;
V_VT(&Properties[7].vValue) = VT_BOOL;
V_BOOL(&Properties[7].vValue) = VARIANT_FALSE;
Properties[8].colid = DB_NULLID;
Properties[8].dwOptions = DBPROPOPTIONS_REQUIRED;
Properties[8].dwPropertyID = DBPROP_CLIENTCURSOR;
V_VT(&Properties[8].vValue) = VT_BOOL;
V_BOOL(&Properties[8].vValue) = VARIANT_TRUE;
Thanks,
Jason
|
|
|
|
|
Hi all,
I created a COM, in which I defined an enum
typedef enum
{
Time_Undefined,
CA,
ms,
s
}TimeBase;
When I import this COM into a program written in C++, everything is fine. But if I import this COM into matlab, Matlab doesn't recognise the variable type above.
Does anyone know how to solve this problem.
Thanks in advance.
|
|
|
|
|
Hi!
I designed COM+ Service with .NET. (Window2003)
I deployed My COM+ Service to ClientPC. (WinXP)
(deployed type is Application proxy)
I installed deployed proxy( .MSI file) at Client PC. (installation success)
I confirmed that proxy is running.
but, when i called proxy method, error occurred.
Msg is "access is denied".
Event log is that
"aceess is denied at DCOM", while server computer is activating, this error is occurred".
i changed my COM Properties(Permission, Security ...) according to other DCOM Access Tips.
but, it didn't work.
Please, give me an answer.
Thanks for regards.
|
|
|
|
|
I made a COM (dll) server, i hope it will work in the local
network as a DCOM , because i haven't tried it yet. So it
is three tier Database Architecture, the client programm
sends a query to the server programm ant it sends a CSV
formated data.
The first question - i tried to use ADO (_Recordset) - as
return parameter, but had error in the IDL file, i didn't
know how to avoid it, and i changed it to IUnknow, but in
the client programm i couldn't dispatch it: i did this:
In The Client:
_Recordset* pRecordset = pDatabase->GetMaterials();
ANd it ruturns 0 = WHY???
In The Server:
GetMaterials(IUnknown* pRecordset)
{
_RecordsetPtr p(__uuidof(_Recorset))
//Some Query Procedure
//And in the finish
_RecordsetPtr->QueryInterface(__uuidof(_Recordset),(void**)
&pRecordset);
return S_OK;
}
And Another Question.
Server Should be able to change the address of Database.
For example now = the addres is C:\econ.mdb;
but if the database in other place?
I tried to use GetModulFileName() - but it returned -
C:\Windows\System32\Svchost.dll.
The Main question is - how to find out where my dll
placed...
Thanks.
|
|
|
|
|
I have this strange bug witih safearrays. I was hoping you understood what is going on, so I could learn something from my mistake.
The interface I’ve designed has a method Foo
[id(7)] HRESULT Foo([in] SAFEARRAY(double)* pSA);
The function goes like this:
Foo(SAFEARRAY** pSA)
{
//destroy the incoming array
SafeArrayDestroy (pSA);
//create a new one of desired size
*pSA = SafeArrayCreateVector(VT_R8,0,10);
return S_OK;
}
In VB, I am calling the function:
Public Sub Func()
Dim arr1() as double
Dim arr2(1) as double
Obj.Foo(arr1)
MsgBox UBound (arr1)
//messagebox reports UBound is 9
Obj.Foo(arr2)
MsgBox UBound (arr2)
//messagebox reports UBound 1
End Sub
|
|
|
|
|
Change the [in] to [in,out].
The marshaller doesn't know it's supposed to send it out, otherwise.
Steve S
Developer for hire
|
|
|
|
|
Hello,
SteveS has a strong point on his reply but accidentally,
What you get is correct behavior.
the arr2 parameter in VB is a static declaration of an array with only 1 item in it, so the call to "SafeArrayDestroy(arr2)" probably fails with a meaningful error code and does not destroy the array.
On the other hand the arr1 parameter is a dynamic safe array and is allowed to be destroyed inside your C++ method.
You might also have a look at
http://www.codeproject.com/atl/udtdemo.asp
Hope This helped
Ioannis
|
|
|
|
|
Hi all,
I'm trying to write a program that can use the facilities added to XP SP2 to determine whether a given file was downloaded from the internet or not.
SP2 uses NTFS streams to attach this information to the file. Here's what I came up with:
I've used the streams.exe utility from SysInternals[^] to determine the stream name. streams.exe outputs the following for a given file:
:Zone.Identifier:$DATA 26
I can view the content of the stream like this:
more < blah.exe:Zone.Identifier
...which outputs this:
[ZoneTransfer]
ZoneId=3
According to the URLZONE definition in urlmon.h, 3 is URLZONE_INTERNET...perfect. Other files (not downloaded) simply don't have the Zone.Identifier stream.
I'm quite new to streams and I'm probably lucky to have made it thus far. Problem is, this looks like a kludge to me. I'd like to go through the "proper" interfaces to retrieve this information.
Further research on MSDN lead me here[^]. IZoneIdentifier's GetId() function seems to be exactly what I'm looking for.
I'm new to streams, but I'm even more of a newbie when it comes to interfaces, COM, ATL and all that lovely, er, stuff.
I have the February 2003 Platform SDK installed. Obviously, the corresponding urlmon.h/urlmon.idl don't contain the definitions I need. Even if I had the file(s), I'm not sure I'd be able to use midl to generate the interface, or use midl's output properly. See where I'm going with this?
I'm guessing a functioning sample for this shouldn't be terribly long...can anyone offer help, starting with "how do I get the proper declarations"? The only hit on Google re: IZoneIdentifier brings me back to MSDN...looks like this is still very new, and I can't find any more references to this...
|
|
|
|
|
You replied yourself at the beginning of the question - you're using the new facilities added in XP SP2. But you're still using the old February 2003 SDK. I think, that downloading new Platform SDK for Windows XP SP 2 would help you to find the proper definitions of interfaces and all that stuff.
http://www.microsoft.com/msdownload/platformsdk/sdkupdate/[^]
Anyway thank you for describing how the mechanism worked, I just had some thinking about how they did it and I do forgot completelly about the streams in NTFS. Thank you.
|
|
|
|
|
> You replied yourself at the beginning of the question - you're using the new facilities added
> in XP SP2. But you're still using the old February 2003 SDK.
Right...which I why I inquired about getting updated headers.
To be honest, I only install the Platform SDK whenever it's updated on the MSDN CDs I get. I never looked into getting "live" updates...so thanks for that link.
> Anyway thank you for describing how the mechanism worked, I just had some thinking about how
> they did it and I do forgot completelly about the streams in NTFS. Thank you.
No problem--I read about how it used streams a while back, but never "really" looked any deeper into it until now. What I've found and posted about seems to be rather consistent, but I still think using streams is relying on an "undocumented dirty hack", so if the stream name changes, my code might stop working (who knows if those type of implementation details will remain the same in 2003 SP1 and beyond)...which is why I wanna try using that interface.
|
|
|
|
|
Well...I got slightly farther. Now I'm really gonna show my lack of COM experience.
This is what I currently have, slightly tweaked from some old sample. So far, this is just a simple console application:
#include <windows.h>
#include <tchar.h>
#include <urlmon.h>
int main( void )
{
HRESULT h = CoInitialize( NULL );
if( (S_OK != h) && (S_FALSE != h) )
return -1;
IZoneIdentifier* pZI = NULL;
h = CoCreateInstance(
CLSID_PersistentZoneIdentifier,
NULL,
CLSCTX_INPROC_SERVER,
IID_IZoneIdentifier,
(LPVOID*)&pZI );
if( FAILED( h ) )
return -1;
[...]
CoUninitialize();
return 0;
}
The code compiles fine, however the linker is complaining it can't find _CLSID_PersistentZoneIdentifier and _IID_IZoneIdentifier.
The updated Platform SDK's urlmon.h defines the CLSID as:
EXTERN_C const IID CLSID_PersistentZoneIdentifier;
That's the only reference I can find on my entire hard drive. The variable is declared as extern, but not defined elsewhere...likewise, _IID_IZoneIdentifier is defined in the same file as:
EXTERN_C const IID IID_IZoneIdentifier;
Where am I supposed to find those definitions?
|
|
|
|
|
Sorry for delay, but I wasn't notified by the CP, because you replied to your reply, hence I fond it by pure coincidence )
Anyway I would expect, that from what you described, there's some .lib file required to be added to the project. I don't have the newest SDK (and as until end of week I can connect only through GPRS, I'll not have it soon) I can't tell you which one it should be, but I suspect that Urlmon.lib should do the work.
|
|
|
|
|
Thanks for following up.
I already tried linking to urlmon.lib to no avail. Lots of "unresolved externals" messages re: CLSIDs being posted on Google's Usenet archive suggest to #define INITGUID, #include <initguid.h>, add uuid.lib to the project, etc. None of these help.
I'm quickly running out of ideas...
|
|
|
|
|
I'm just downloading the new SDK, I hope I will be able to help you later today evening.
|
|
|
|
|
aghrr, once more, today's CP problems vanished my effort in writing the final response
Anyway, managed it to compile! Hooray!
I hadn't too much time for that research, but I found following:
In new updated urlmon.h the IZoneIdentifier uses the macro MIDL_INTERFACE that allows to use the brand new special microsoft __uuidof .
Problem remains with the CLSID_PersistentZoneIdentifier . Although his fellows CLSID_InternetSecurityManager and CLSID_InternetZoneManager are known and will compile, this one is obviously missing.
As I don't have too much time for the research, I just hotfixed it by adding the definition of the CLSID_PersistentZoneIdentifier by hand, before the main function in your example:
static const GUID CLSID_PersistentZoneIdentifier =
{ 0x0968E258, 0x16C7, 0x4DBA, { 0xAA, 0x86, 0x46, 0x2D, 0xD6, 0x1E, 0x31, 0xA3 } };
and the final result is then:
h = CoCreateInstance(
CLSID_PersistentZoneIdentifier,
NULL,
CLSCTX_INPROC_SERVER,
__uuidof(IZoneIdentifier),
(LPVOID*)&pZI
);
Compiles and also creates some object in return.
Hope that helps.
|
|
|
|
|
geo_m, you're my new hero.
I thought about manually adding the definition myself, but I wasn't too sure about how to proceed (again, my COM experience is limited). May I ask how you came up with that GUID?
I'll give this a shot. Thanks a million!
|
|
|
|
|
Hi,
glad that it helped. To get any GUID already registered in the system you can use the OLE/COM object view utility. This utility is a part of the VS.NET distribution and can be found also in the tools in SDK.
Here you can list all registered interfaces, objects and typelibs, with a bit of patience you can find here whatever needed )
|
|
|
|
|
> with a bit of patience you can find here whatever needed
I had everything but not that.
The OLE/COM object viewer really needs a search function...
|
|
|
|
|
Hello all,
I'm now wrting an IDL file for COM. if I want to return a vector of string, what can I do?
The method that I want is following in c++
vector<string> Function();
As far as I know, a string can be BSTR in IDL, so what in IDL corresponds to a vector or an array in C++?
Thank you very much!
|
|
|
|
|
Try SAFEARRAY.
But I think it is not recognized by MIDL compiler. Let me know if you find some other way of using arrays in IDL that MIDL recognizes.
Have a great day ahead!
Regards,
Sohail Kadiwala
(My Blog - http://blogs.wdevs.com/sohail/[^])
modified 21-Apr-21 21:01pm.
|
|
|
|
|
SAFEARRAY(BSTR) should be recognised and understood perfectly well by MIDL. I've worked on projects that made heavy use of these things, and stuff like SAFEARRAYs of user defined types
Steve S
Developer for hire
|
|
|
|
|