I want my doc file to be only read from an authorized computer or from local network, and prevent others copy my doc file. Is that possible?:-> Vincent
dragooooon lee
Posts
-
--------anti-copy problem -
---how to lock two mutexes simultaneously in atomic mode?hi ,Ryan and Rilhas the context is producer/consumer thread1 ---------------------------------------------- p(empty) mutexRW.lock() produce(item) mutexRW.unlock() v(full) ----------------------------------------------------- thread2 ---------------------------------------------- p(full) mutexRW.lock() comsume(item) mutexRW.unlock() v(empty) ----------------------------------------------------- I need to stop thread1 and thread2 sinultaneously in thread3 to avoid deadlock at p(empty) in thread1 for buffer is full or deadlock at p(full) in thread2 for buffer is empty. and I can't use a third mutex to achieve that because a third mutex would be unefficient for producer/consumer. so give me some clues to solve this problem please. thanks :confused: Vincent -- modified at 12:48 Tuesday 2nd May, 2006
-
---how to lock two mutexes simultaneously in atomic mode?mutex1 in thread 1 mutex2 in thread 2 how to lock the two mutexes simultaneously in thread 3?:confused: Vincent
-
----how can I recieve a custom message sent from COM server to C# client?---how can I recieve a custom message sent from COM server to C# client? if I send a message in the range 0 to WM_USER-1, it works. but fail when I send a message above WM_USER? can someone solve this problem for me? thank you very much! Vincent
-
????How to return a self-defined type pointer from COM objecthi,all I want a self-defined type pointer to be returned from my COM object to C#. and then use the pointer to initialize another COM.how should I do? regards Vincent -- modified at 2:41 Wednesday 29th March, 2006
-
@^@ how to handle a pointer returned by a COM interfaceIt's ugly since it's just a test. Thanks anyway.Maybe I need to read some books about interoperation to figure it out:rolleyes: Vincent
-
@^@ how to handle a pointer returned by a COM interfaceit's ugly since it's just a test. thanks anyway.maybe I need to read some books about interoperation to figure it out.:sigh: Vincent
-
@^@ how to handle a pointer returned by a COM interfaceimport "oaidl.idl"; import "ocidl.idl"; [ object, uuid(853b4626-393a-44df-b13e-64cabe535dbf), nonextensible, pointer_default(unique) ] interface IMyComponent : IUnknown { [id(1), helpstring("method Initialize")] void * __stdcall Print(BSTR msg); }; [uuid(0c6bb614-8563-49ea-b5ce-e6b7febebc27)] coclass RtpSource { interface IMyComponent ; }; ------------------------------------------------------------ C# code IntPtr p = ((IMyComponent)rtpsource).Print(s); StringBuilder sb = new StringBuilder(); sb.Append(Marshal.PtrToStringBSTR(p)); Vincent
-
@^@ how to handle a pointer returned by a COM interfaceimport "oaidl.idl"; import "ocidl.idl"; [ object, uuid(853b4626-393a-44df-b13e-64cabe535dbf), nonextensible, pointer_default(unique) ] interface IMyComponent : IUnknown { [id(1), helpstring("method Initialize")] void * __stdcall Print(BSTR msg); }; [uuid(0c6bb614-8563-49ea-b5ce-e6b7febebc27)] coclass RtpSource { interface IMyComponent ; }; Vincent
-
@^@ how to handle a pointer returned by a COM interfaceSystem.AccessViolationException caught when I use CoTaskMemAlloc():(( Vincent
-
@^@ how to handle a pointer returned by a COM interfacehi,Jared my COM was built in pure unmanaged code.I can't use AllocCoTaskMem,can I? Vincent
-
@^@ how to handle a pointer returned by a COM interfaceassume the following method in a COM virtual void * __stdcall Print(BSTR msg){ char * buf= new char[128]; sprintf(buf,"return by print interface"); return (void *)buf; } how should I handle the returned pointer by the method above in C#, so that I can get the proper string set by the method? :laugh: Vincent