|
hi srivarstava
exactly i did it before u mailed me !!!! thanks a lot !!!
what i did was
i opened the CNewDialog.h and added the folowoing in the onOk handler ( ur right after OnOk the dialog leaves memory !! so how can i get the control data persistent ? thats a mistake ) ..
LRESULT OnOK(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
{
HWND wnd=GetDlgItem(IDC_NAME);
CEdit ed;
ed.Attach(wnd);
CString str;
ed.GetWindowText(str);
st=str; // this st is a member i added to the class newdialog coz i am able to access it from outside the class by typing CString mystr= dlg-->st ..cool..
EndDialog(wID);
return 0;
}
now i got i t...
thanks for ur continued support ...and one more thing ...how can i add a Explorer bar to be fired when i click button ?? I want to open a site www.google.com when i click a button ...and one more thing ...i have office 9 so that in the atdafx.h i am hardcoding the dlls needed as
#import "C:\Program Files\Microsoft Office\Office\mso9.dll" rename_namespace("Office"), named_guids
using namespace Office;
#import "C:\Program Files\Microsoft Office\Office\MSOUTL9.olb" rename_namespace("Outlook"), named_guids, raw_interfaces_only
using namespace Outlook;
but the same dll is not ok for office2002 ..it uses outlook 10 ..so i need to have a functionlaity withwhich i can find whihc version of dll is present in the registry and /..and i have to accoringly #import the necessary dll ( like mso10.dll and msoutl10.dll ) ..so help me in this regard also ...one more ..i am going toadd a nwe Creordset class from this ATL COM proj ...any advise on possible prob i will face when i link with DB ??
thanks a lotttt
with regards
dharani
|
|
|
|
|
Hi
I have one tiny question?
Wich header file do I must include for CEdit object?
I included <afxwin.h> but I get an error
***\VC98\MFC\INCLUDE\afxv_w32.h(14) : fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include <windows.h>
If I dont include <afxwin.h> I get error of undefined member
'CEdit' : missing storage-class or type specifiers
Tomaz Rotovnik
|
|
|
|
|
Just pass the HWND to your CNormalDlg constructor. Inside the constructor when you either use a wrapper class or create the window manually (via RegisterWindow then CreateWindow , or their extended equivalents) you pass the parent HWND that was passed to your constructor. If this is an MFC class - and it appears to be - and you're deriving from CDialog - and your class name indicates such - then call the base class constructor for CDialog which takes a parent CWnd . Don't forget to call the base class constructor, though.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
i guess i have answered your this question in some other thread...
this Line should solve ur problem. Just put it at the start of each method
where you are invoking dialogs, basically every where if you are using MFC in COM
AFX_MANAGE_STATE(AfxGetStaticModuleState( ));
The World is getting smaller and so are the people.
|
|
|
|
|
missing AFX_MANAGE_STATE(AfxGetStaticModuleState()) ???
|
|
|
|
|
Hi all,
I’m a student programmer working on the last industry project of my program.
The project requires a custom wizard to call the native Visual Studio wizard (Data adapter configuration wizard) via the DTE.LaunchWizard method. My problem is that when my wizard executes the LaunchWizard method, I receive a ‘The Parameter is Incorrect’ error. I have used the documentation on MSDN, and scoured the internet for related information, but no mater what I try, I can not get rid of that error. Have any of you used this method? If you have, could you tell me where I’m going wrong, or post the correct usage of the required parameters?
Much Thanks!
|
|
|
|
|
I create one asp component in vc++ o add mime to add new IIS.t works fine when using with vb
but not working with asp.
i can give my source as below
vc++ code
.............
STDMETHODIMP CDefaultDoc::SetMimeType(VARIANT *newVal)
{
try
{
_variant_t vtArray(newVal);
VARTYPE vt = V_VT(&vtArray);
if (vt & VT_ARRAY)
{
USES_CONVERSION;
HRESULT hr;
long lIdx;
long lHigh;
BSTR bstrBuff;
BSTR bstrRaw;
CComQIPtr<IISMimeType> MimeType;
CComBSTR bstrClassName = NULL;
IADs* pIISprop = NULL;
bstrClassName = L"IIS://localhost/W3Svc/";
bstrClassName += m_bStrSiteNo;
bstrClassName += L"/ROOT";
hr = ADsGetObject(bstrClassName,IID_IADs,
(void**)&pIISprop);
SAFEARRAY * psa;
VARIANT vElem;
::VariantInit(&vElem);
SafeArrayCopy(*(vtArray.pparray), &psa);
::SafeArrayGetLBound(psa, 1, &lIdx);
::SafeArrayGetUBound(psa, 1, &lHigh);
while(lIdx <= lHigh)
{
hr = ::SafeArrayGetElement(psa, &lIdx , &vElem);
if(SUCCEEDED(hr))
{
if(vElem.vt & VT_DISPATCH)
{
MimeType = vElem.pdispVal;
if(MimeType != NULL)
{
create one safearrau and put
here
}
MimeType.Release();
}
}
lIdx++;
} // Loop through elemen
CComVariant VatProp;
VariantCopy(&VatProp,&oldVariant);;
hr = pIISprop->Put(L"MimeMap",VatProp);
hr = pIISprop->SetInfo();
file.close();
}
}
catch(...)
{
}
return S_OK;
}
.........................................
Asp code
Dim aMimeMapNew()
i = 0
For x = 1 To 3
ReDim Preserve aMimeMapNew(i)
Set aMimeMapNew(i) = CreateObject("MimeMap")
aMimeMapNew(i).Extension = ".asp" & CStr(i)
aMimeMapNew(i).MimeType = "ggggg" & CStr(i) & "/" & "sssss" & CStr(i)
i = i + 1
Next
Response.Write "Array Created........."
Dim serverObj
Set serverObj = server.CreateObject("hmIISProp.DefaultDoc")
serverObj.SiteNumber = "3"
Response.Write serverObj.SiteNumber
serverObj.SetMimeType(aMimeMapNew)
Set serverObj = Nothing
please reple me
|
|
|
|
|
The input VARIANT parameter can be more complicated than you assume. For example, for array with VARIANT elements you can get the VARIANT with following vt-field:
VT_ARRAY | VT_VARIANT - array - vtArray.parray should be used
VT_BYREF | VT_ARRAY | VT_VARIANT - reference to array - vtArray.pparray should be used
Instead of "SafeArrayCopy(*(vtArray.pparray), &psa);" I would use
SAFEARRAY * psa = (vtArray.vt & VT_BYREF) ? *(vtArray.pparray) : vtArray.parray;
With best wishes,
Vita
|
|
|
|
|
Hi All,
Does anyone have some sample c++ code showing how to use the CoGetClassObjectFromURL() function to download an ActiveX control ?
Any help much appreciated.
Thanks a lot,
John
|
|
|
|
|
An ATL simple object of mathematic structures and functions need overload operator to give facilities to developers.
|
|
|
|
|
I am new to COM and am building a simple MFC dll to get things going. I have everything working except that when I include DllMain in my code the linker balks and tells me that dllmain is already defined in my .obj file.
Any ideas? TIA.
Matt (Padawan Learner)
|
|
|
|
|
Greets,
If I'm not mistaken, MFC has its own DllMain hidden deep down inside. Perhaps you should find it (since the code is included) and mimic what it does inside in order to support MFC in your COM object. However, this might already have been done in the past.
Regards,
Joe
|
|
|
|
|
Thanks.
That got me thinking that my project was not setup as it should be. And low and behold it was not. I needed to be using a MFC Extension dll. Everything works great now. Dumb mistake, but like I said, I am new to COM(and to dlls).
Matt (Padawan Learner)
|
|
|
|
|
Hi:
I have a com+ component installed using a application proxy on a remote computer. By the way, I have no problems when running the local client. I'm using a VB.NET Client.
The problem occurs when I try to execute a method on the remote object:
--------------------------------------------------------------
An unhandled exception of type 'System.InvalidCastException' occurred
in Client.exe
Additional information: QueryInterface for interface
MyComponentLib.IMyInterface failed.
--------------------------------------------------------------
Interestingly, The instantiation of the remote object by CreateObject succeeds and the application is activated on the server machine, i.e., I can see the rolling icon animation.
Activating proxy in OLEVIEW also succeeds.
The security is set to Interactive at this point.
If I use a VB6 client I get 'Run-Time Error 424 Object Required' when I call CreateObject!!
This is a very simple COM+ app but I'm really stuck!
I'll appreciate any help...
Thanks
|
|
|
|
|
Greets,
Is the interface for the COM+ application which is installed on the server also available to your application on the client machine? Did you export the application from the server and install it on the client machine from which your application is running?
When I refer to application, you can install your component in COM+ on the server machine, then use COM+ services to export an MSI package that will install the necessary information on the client needed to make the call remotely.
Regards,
Joe
|
|
|
|
|
The proxy appliction was exported from the server appliations as MSI package which was then installed on the client machine.
The local client works fine.
What I have seen in the debugger is that the remote client can instantiate the component. The query to object's IUnknown interface succeeds, i.e., returns S_OK. However after that what happens I don't know - I can't see it in the debugger.
|
|
|
|
|
How is your client calling CoInitializeSecurity?
Are your client and server using the same or different SIDs?
Steve S
|
|
|
|
|
Hello all,
In my shell extension dll, there are some codes like that (call another COM component):
......
hr = CoGetClassObject(CLSID_Class1, CLSCTX_ALL, NULL,
IID_IClassFactory, (void**)&pcf);
(now hr = S_OK)
hr = pcf->CreateInstance(NULL, IID_Interface1, (void**)&pi);
(ERROR: "Can't find the registered interface")
CLSID_Class1 is also a COM component written by myself and I've written a simple exe app to test this component and find it runs ok. So it means the GUIDs have been registered in the registry successfully and the component itself is correct.
Why the shell extension dll calls the CLSID_Class1 component will be fail but the exe application calls it successfully?
Both the shell extension COM and CLSID_Class COM are all "Apartment" thread model.
Thanks a lot
|
|
|
|
|
Hi,
I read in a book on COM that COM is language independent viz. you can create and use COM components in any language. I was wondering how do I go about using a COM component (created in VC++) in a Java client program?
Thanks,
Melwyn
|
|
|
|
|
|
Yeah, it was not exactly what I was looking for, but thanks anyway.
Regards,
Melwyn
|
|
|
|
|
can anyone show me how to make some parameter of a method as default.
Like this:
STDMETHOD(Test)(BSTR bsValue);
how to make "bsValue" as a default parameter like in c++(Test(BSTR bsValue=NUU)
Many many thx
|
|
|
|
|
For C|C++ clients there is no sense for this - they must always specify the parameter.
Though MIDL has two keys to do it - [defaultvalue] and [optional]. The [optional] applies to the VARIANT parameter. The [defaultvalue] applies to other types.
With best wishes,
Vita
|
|
|
|
|
I have created a toolbar . Now i need to deploy it over the net . I have used two dll files created in the .net framework . I created a cab file which is referenced through the codebase object in the html page . Now when this page is referenced, the inf script is interpreted and the dll's are copied to the mentioned directories and the necessary entries are made . How do i register these into the assembly cache . When i do it manually i use the gacutil and the regasm . But what is the method for doing this while deploying over the internet using a cab file . in the inf file can i mention a batch file to be executed or a dos command to be executed . I heard that the dll's can be built to register themselves . Is it true . If so how di i do it .
Please Help
Srikar Y
NITK Surathkal
|
|
|
|
|
Hi,
Your best approach would probably be to create an MSI installation package for your component. It will package all of the dependencies required (if necessary) and also register your component into the GAC (Global Assembly Cache) if you create that folder in your installation project and ensure that you strongly name your component by signing it with the generated key.
If you are referring to other means of COM component registration, it still requires the registration of a type library which can be created and installed as part of the package as well.
Regards,
Joe
|
|
|
|