|
When I call function from client ,it returns error
0x800706b9(resource is not enough).But after I change position between client and server ,it's ok.Why?
Example:
Server: Windows2000,Visual Studio.NET
Client: Windows2000,Visual Studio 6
It's failed
Server: Windows2000,Visual Studio 6
Client: Windows2000,Visual Studio.NET
It's ok
|
|
|
|
|
Sorry for what may seem like a series of dumb questions.
There is a project my team may be working on and we have not much exposure yet to SOAP. The project will consist of wrapping or chaning the existing DCOM interface to SOAP or some other .Net friendly interface that managed code can use.
Currently, we have methods/functions that get and set data to a remote server and work something like this:
#define RD_MEDIA_TYPE DATA_TAG( RDT_LONG, 0x0301 )
#define RD_SUBMIT_TIME DATA_TAG( RDT_FILETIME, 0x0302 )
#define RD_SUBJECT DATA_TAG( RDT_LPTSTR, 0x0303 )
#define RD_CALLER_ID DATA_TAG( RDT_LPTSTR, 0x0305 )
#define RD_CALLER_NAME DATA_TAG( RDT_LPTSTR, 0x0306 )
#define RD_LENGTH DATA_TAG( RDT_LONG, 0x0307 )
#define RD_IMPORTANCE DATA_TAG( RDT_LONG, 0x0308 )
#define RD_SND_CALLER_NAME DATA_TAG( RDT_FILE, 0x030D )
#define RD_SND_BODY DATA_TAG( RDT_FILE, 0x030E )
#define RD_TXT_BODY DATA_TAG( RDT_FILE, 0x030F )
#define RD_FAX_BODY DATA_TAG( RDT_FILE, 0x0310 )
pHost->GetMessageProps( szID, 8,
RD_MEDIA_TYPE, &lMediaType,
RD_SUBMIT_TIME, &timeSubmit,
RD_CALLER_NAME, &strSender,
RD_CALLER_ID, &strCallerID,
RD_SUBJECT, &strSubject,
RD_IMPORTANCE, &lPrior,
RD_LENGTH, &length,
RD_FAX_BODY, (IBin*) &bin);
We define data tags as many types including binary objects, strings, string arrays, binary arrays, time, bool, long, etc... all with variable lengths. The function takes a paramater (second paramater) to determine the number of properties we are setting or getting. There is no requirement that the properties be in any order, just that the address is the correct data type. The number of properties can be anywhere from 1 to hundreds (well, we only have about 50 defined currently) in one function call.
We also have functions like:
and like:
CStringArray saIDs, saAttns;
m_pHost->GetRoutingInfoByMboxID(szMBox, g_szaType[iType], &saIDs, &saAttns)
Can I easily wrap these functions as methods that managed code could make use of? What would it look like? I am especially interested if anyone has done this type of work before... did you have to rewrite your code or was it easy to wrap your DCOM interface with SOAP type interfaces?
|
|
|
|
|
How do you get the count of the currently executing objects in a COM+ application. I need to track the number of objects currently running as the objects are created and destroyed.
I have been looking at the COM+ Administration Collections, and so far it seems that most of the collections are not for the live objects (objects currently running). Where else should I be looking?
Thanks
Gaul
Gaulles
|
|
|
|
|
Hello All,
I have a validation, replacing quotation mark in my dll as soon as surname or first name has been passed from my form.
The code is : CStr(Replace(Trim(surname), "'", "$0"))
The problem is when I type a surname = "O'Brian" the data does not go to the database and has internal server error.
Can anybody suggest any other way I can liminate this problem?
Many Thanks
Bravo Two Zero
A pen is mighter then a sword.
|
|
|
|
|
Friends Pls help me.
I wants to add the MS paint as Active Document
in my MFC application.
How can I do that
Hemant
|
|
|
|
|
MS Paint lives both as a stand alone app, and as an insertable OLE object. I got its clsid by just starting MSDEV OLEView and then by looking into the OLE 1.0 object hierarchy, where I have found :
-"PaintBrush picture"
-CLSID={0003000A-0000-0000-C000-000000000046}
-localserver32=...\mspaint.exe
-...
|
|
|
|
|
Thanks
but insted of using direct CLSID I used it like this
if(S_OK != CLSIDFromProgID(OLESTR("pBrush"), &dlg.m_io.clsid))
{
return;
}
Is this correct ? Or any problem
|
|
|
|
|
Replace pBrush with Paint.Picture
(it's declared in the registry : HKCR\Paint.Picture)
|
|
|
|
|
I am working with a project which handles large compound files. Now I face a problem with IStream::Write().
IStream::Write()retuns an error STG_E_DOCFILETOOLARGE (Error:"The compound file is too large for the current implementation").
I am trying to write in a compound file created with 512 Byte sectors (Info MSDN see below). The current file size is about 300 MByte and the number of streams are about 100000 ! The error occurs only with Win 2000 SP3 and XP SP1. In Win NT 4.0 SP6a it works !!! When I create the file with 4096 Byte sectors in StgCreateStorageEx, IStream::Write works for Win 2000 and XP too. Now my question: Is this a bug?
Info from MSDN Library:
The compound file implementation can be configured to use 512 or 4096 byte sectors, as defined in the STGOPTIONS structure. File size limits: 512: 2 gigabytes (GB) 4096: Up to file system limits Number of elements in a file: 512: Unlimited, but performance may degrade if elements number in the thousands 4096: Unlimited
Mainul Hossain
Germany
|
|
|
|
|
What implementation of IStream are you using (how do you create stream object)?
|
|
|
|
|
Hello!
I have a COM (ATL) object IDataProvider which used to provide data to some services. This object can be used from other processes.
Also I have a C++ object which contains data and I need to attach this object to IDataProvider object somehow.
eg:
class CDataContainer
{
...
};
class ATL_NO_VTABLE CDataProvider :
public CComObjectRootEx<ccommultithreadmodel>,
public CComCoClass<ctestdataprovider, &clsid_dataprovider="">,
public IDataProvider
{
...
}
I need something like this:
void CDataContainer::DoDataExchange(pDX)
{
CComPtr<idataprovider> pDataProvider;
pDataProvider.CoCreateInstance(CLSID_DataProvider);
pDataProvider->SetDataContainer(this);
// pDX object can be located in another process
pDX->DoDataExchange(pDataProvider);
}
========================================================
IDataProvider object can be created only from DLL which contains CDataContainer code. Can I use it like this:
class CDataContainer
{
...
};
class CDataProvider : public IDataProvider
{
...
}
void CDataContainer::DoDataExchange(pDX)
{
CDataProvider* pDataProvider = new CDataProvider(this);
// pDX object can be located in another process
pDX->DoDataExchange(pDataProvider);
}
With regards,
Pavel Krupets
|
|
|
|
|
It has to be a COM object. Try IDataObject interface.
|
|
|
|
|
Hello!
Thank you for reply.
Do you mean I cannot use "class CDataProvider : public IDataProvider"?
If so I was almost sure it won't do the trick.
But in my case I cannot pass data to server, it have to ask me for it. Because it might use only part of it and it isn't right to load everything.
With regards,
Pavel Krupets
|
|
|
|
|
What I meant is for your SetData(...), you need some COM interface to pass as parameter. something like:
SetData([in]IMyDataHolder* pHolder);
IDataObject is standard interface and seems appropriate for a job. If it does not satisfy your needs, you should create another interface. The main idea is that if you have C++ class and you want to use it in COM , there is only one way to do it - it is to encapsulate it in the COM object.
|
|
|
|
|
Hello!
It's impossible to encapsulate this object inside COM object. Due to application architecture. And I think the only solution is to gather all data and pass it into the server.
Thank you...
With regards,
Pavel Krupets
|
|
|
|
|
Hello!
In my case it can be solved like this:
class CDataProvider : public IDataProvider
{
CDataProvider(CDataSource* pSource);
...
};
void CDataSource::DoDataExchange(IServer* pServer)
{
CComPtr<idataprovider> pDP;
pDP.Attach(new CDataProvider(this));
pServer->DoDataExchange(pDP);
// pDP will be destroyed here...
}
This will work even if pServer is in another process.
With regards,
Pavel Krupets
|
|
|
|
|
Is there a way to convert a HGLOBAL memory handle to a Safarray of VT1, without copying memory ?
Jonathan de Halleux.
|
|
|
|
|
|
I want to get "selected ELEMENT" or "selected ELEMENT Collection" in MSHTML.
--------------------------
IHTMLDocument2 *pDoc2;
IHTMLSelectionobject *pSel;
IHTMLTxtRange *pRange;
pDoc2->get_selection(&pSel);
pSel->createRange(&pRange);
pRange->parentElement(--);
----------------------------
I got the element by the above.
But This is not that I wished.
abc
abc2
if "table element" & "font element" is selected,
I will get "body element".
Then I will process to process-undesired "span element".
I want to create what I processes only selected elements.
Therefore, I want to get "ELEMENT collection".
Please tell me!!
|
|
|
|
|
|
Thank you for a reply.
But I want to create "IHTMLElement object" from "IHTMLTxtRange object" or "document selection".
I thought the same idea as Franks's.
But I cannot process the element which does not have ID in an attribute.And I may do wrong processing.
IHTMLTxtRange *pRange;
pRange->get_htmlText(&BSTR);
For example,BSTR is the below
defg1 '1
defg2 '2
defg3 '3
As the above,"'2" isn't processed.
Can "the MSHTML" directly change a selection into the element?
|
|
|
|
|
jajamal wrote:
I thought the same idea as Franks's.
But I cannot process the element which does not have ID in an attribute.And I may do wrong processing.
Ok, what prevents you from adding the id attribute on the fly ?
|
|
|
|
|
Thank you for a reply.
The idea has bad affinity with a "the script" in my program.
But I considered another method.I have not made yet.
1. I surrounds the selection elements with a new element .
2. I may get the element collection from a new element(parent element)
3.the processing
4. delete only parent element.
Now, I am writting source.
|
|
|
|
|
I developed a ASP component which can create process,I want it run a program which will product some files,but the problem is the ASP component created process and didn't product files.
the code is follow:
STDMETHODIMP CWebExam::CompileFile()
{
AFX_MANAGE_STATE(AfxGetStaticModuleState())
// TODO:
STARTUPINFO si;
PROCESS_INFORMATION pi;
ZeroMemory( &si, sizeof(si) );
si.cb = sizeof(si);
ZeroMemory( &pi, sizeof(pi) );
// Start the child process.
if( !CreateProcess( NULL, // No module name (use command line).
"e:\\web2\\exam\\cl.exe /Fee:\\web2\\exam\\ /Foe:\\web2\\exam\\ e:\\web2\\exam\\test2.cpp", // Command line.
NULL, // Process handle not inheritable.
NULL, // Thread handle not inheritable.
FALSE, // Set handle inheritance to FALSE.
0, // No creation flags.
NULL, // Use parent's environment block.
"e:\\web2\\exam\\", // Use self starting directory.
&si, // Pointer to STARTUPINFO structure.
&pi ) // Pointer to PROCESS_INFORMATION structure.
)
{
error=1;
//MessageBox(NULL,"create process wrong",NULL,MB_OK);
}
else
{
error=0;
}
// Wait until child process exits.
WaitForSingleObject( pi.hProcess, INFINITE );
// Close process and thread handles.
CloseHandle( pi.hProcess );
CloseHandle( pi.hThread );
return S_OK;
}
|
|
|
|
|
Difficult to say, but I would check the rights - because I think that the process running under the IIS web account (this IUSR_xxx), so it might be that it have no rights to create a file or do any other action.
If it runs when started normally (under your account), it will probably be some rights problem.
|
|
|
|
|