optional method parameter in MFC ActiveX

How do you set a method parameter as optional in an MFC ActiveX control?

Kurt


0
k_nojunk (20)
1/22/2004 5:56:57 PM
vc.mfc 33608 articles. 0 followers. Follow

4 Replies
1149 Views

Similar Articles

[PageSpeed] 54

"Kurt" <k_nojunk@larimore.net> wrote in message
news:%23HK$bCR4DHA.2468@TK2MSFTNGP09.phx.gbl...
> How do you set a method parameter as optional in an MFC ActiveX control?
>
> Kurt

Depends, (1) do you mean when you create an activex control yourself, and
you wish to make a parameter optional?
Or (2) do you want to pass an optional argument to a method of the ActiveX
control?

Solution (1) : Make it a variant parameter. If the variant is of type
VT_ERROR and the value is DISP_E_PARAMNOTFOUND, then the parameter was not
specified.
Solution (2): Pass the following to the method as parameter:
    COleVariant covOptional(long(DISP_E_PARAMNOTFOUND), VT_ERROR);
Or use some other variant wrapper class that holds the same value
(CComVariant, VARIANT, ...)

Tom.


0
1/22/2004 8:34:29 PM
Thanks!

"TT (Tom Tempelaere)" <_N_OSPAMtiti____@hotmail.comMAPSO_N_> wrote in
message news:ptWPb.600$fq4.151674@phobos.telenet-ops.be...
> "Kurt" <k_nojunk@larimore.net> wrote in message
> news:%23HK$bCR4DHA.2468@TK2MSFTNGP09.phx.gbl...
> > How do you set a method parameter as optional in an MFC ActiveX control?
> >
> > Kurt
>
> Depends, (1) do you mean when you create an activex control yourself, and
> you wish to make a parameter optional?
> Or (2) do you want to pass an optional argument to a method of the ActiveX
> control?
>
> Solution (1) : Make it a variant parameter. If the variant is of type
> VT_ERROR and the value is DISP_E_PARAMNOTFOUND, then the parameter was not
> specified.
> Solution (2): Pass the following to the method as parameter:
>     COleVariant covOptional(long(DISP_E_PARAMNOTFOUND), VT_ERROR);
> Or use some other variant wrapper class that holds the same value
> (CComVariant, VARIANT, ...)
>
> Tom.
>
>


0
k_nojunk (20)
1/22/2004 9:52:22 PM
Tom

I am having trouble figuring out what is exactly in the variant, the client
is a VB client.
My vt value is 48200 and my scode is 1228508.

Kurt

"TT (Tom Tempelaere)" <_N_OSPAMtiti____@hotmail.comMAPSO_N_> wrote in
message news:ptWPb.600$fq4.151674@phobos.telenet-ops.be...
> "Kurt" <k_nojunk@larimore.net> wrote in message
> news:%23HK$bCR4DHA.2468@TK2MSFTNGP09.phx.gbl...
> > How do you set a method parameter as optional in an MFC ActiveX control?
> >
> > Kurt
>
> Depends, (1) do you mean when you create an activex control yourself, and
> you wish to make a parameter optional?
> Or (2) do you want to pass an optional argument to a method of the ActiveX
> control?
>
> Solution (1) : Make it a variant parameter. If the variant is of type
> VT_ERROR and the value is DISP_E_PARAMNOTFOUND, then the parameter was not
> specified.
> Solution (2): Pass the following to the method as parameter:
>     COleVariant covOptional(long(DISP_E_PARAMNOTFOUND), VT_ERROR);
> Or use some other variant wrapper class that holds the same value
> (CComVariant, VARIANT, ...)
>
> Tom.
>
>


0
k_nojunk (20)
1/22/2004 10:10:01 PM
"Kurt" <k_nojunk@larimore.net> wrote in message
news:ei0l2PT4DHA.1644@TK2MSFTNGP10.phx.gbl...
> Tom
>
> I am having trouble figuring out what is exactly in the variant, the
client
> is a VB client.
> My vt value is 48200 and my scode is 1228508.

Maybe you should ask in a VB newsgroup. This is an mfc newsgroup, with less
VB experts ;-)

But perhaps you could use the VC++ debugger the figure out the real values?
Or perhaps the header files that define those constants.

Still I don't know if you want (1) or (2) (see my original answer). IIRC, in
VB you don't specify the parameter if you want it to be the optional case.

Tom.

> Kurt
>
> "TT (Tom Tempelaere)" <_N_OSPAMtiti____@hotmail.comMAPSO_N_> wrote in
> message news:ptWPb.600$fq4.151674@phobos.telenet-ops.be...
> > "Kurt" <k_nojunk@larimore.net> wrote in message
> > news:%23HK$bCR4DHA.2468@TK2MSFTNGP09.phx.gbl...
> > > How do you set a method parameter as optional in an MFC ActiveX
control?
> > >
> > > Kurt
> >
> > Depends, (1) do you mean when you create an activex control yourself,
and
> > you wish to make a parameter optional?
> > Or (2) do you want to pass an optional argument to a method of the
ActiveX
> > control?
> >
> > Solution (1) : Make it a variant parameter. If the variant is of type
> > VT_ERROR and the value is DISP_E_PARAMNOTFOUND, then the parameter was
not
> > specified.
> > Solution (2): Pass the following to the method as parameter:
> >     COleVariant covOptional(long(DISP_E_PARAMNOTFOUND), VT_ERROR);
> > Or use some other variant wrapper class that holds the same value
> > (CComVariant, VARIANT, ...)
> >
> > Tom.
> >
> >
>
>


0
1/23/2004 3:12:22 PM
Reply:

Similar Artilces:

Cached Report is returned when date parameter is NULL
Hi, I am facing this problem. Please help me. I have a report with date parameter along with many other parameters. First I entered a date value and generated the report from my application. I am getting the correct report. But when I cleared the date value and regenerated the report i am getting the last generated report.(The time stamp shows the old value which is getting from the cache) My code is like this in the application: ReportingService rs = ReportServiceBuilder.ReportService;//Calling remote environment for service. rs.UseDefaultCredentials = true; ...

RMS matrix attribute option
Adding an existing item in the RMS 2.0.0114 matrix with 219 attributes and 826 items and saving it takes about 2 hours to complete (using Windows XP SP2 Pentium D 3.0 Ghz with 2 G RAM). Since the backend is SQL Server, we don’t see any reason for the application not to support matrix records of this size, considering that the Item has 219 attributes and 826 items only. I think it would be better if RMS has the option not to load the existing attributes for the dropdown list. Just enable the addition of new dimensions. ---------------- This post is a suggestion for Microsoft, and Micro...

Why No "Format Cells" Choice Option Always ?
Hello, Using Excel 2007. When I select a Column of numbers, I usually see a choice for "Format Cells" At other times, for different Columns (also with numbers in the cells, I do not get the Format Cells choice. All that shows up as being selectable are: Cut, Copy, Clear Contents Why might this be ? Thanks ...

ActiveX inside a CDHtmlDialog
Hi... I am asking how to access my activex control that is embedded in the html in my CDHtmlDialog derived class. I mean how to link my CMyActiveXClass instance of my dialog to the OBJECT element in the HTML. Also how to sink the activex own events Thanks! GetControlDispatch Retrieves the IDispatch interface on an ActiveX control embedded in the HTML document. for event sinking, see msdn.microsoft.com/workshop/browser/mshtml/tutorials/sink.asp -- Regards Sheng Jiang Microsoft Most Valuable Professional in Visual C++ http://www.jiangsheng.net http://blog.joycode.com/jiang...

Why is redirect rule absent from my rules and alerts options?
Outlook 2003 help at <http://office.microsoft.com/en-au/outlook/HA011502011033.aspx?pid=CH063564671033> offers a choice of either forwarding or redirecting mail. I want to redirect mail to a webmail address to access it more easily while travelling. Redirect suits me better than forwarding, as forwarded mail all appears to come from me (i.e. original sender is not visible until mail is opened -- bit inconvenient). The forwarding option/s are visible among the checkboxes under 'Rules and alerts' but there is no sign of the 'Redirect it to people or distribution list&#...

MFC(VS6) and ADO.Net
hi guys, is possible to connect ADO.Net to MFC(VS6)???? if yes...how do i go about it???? tks a lot.. God Bless Joseph R. Thomas wrote: >hi guys, >is possible to connect ADO.Net to MFC(VS6)???? >if yes...how do i go about it???? >tks a lot.. >God Bless This is called "interop" and you can find more on using .NET components from unmanaged code here: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconexposingnetframeworkcomponentstocom.asp?frame=true -- Doug Harrison Microsoft MVP - Visual C++ but i am not using COM!!! Jsoeph R. ...

Tools,Options, Email Options, AdvancedE-mail Options,
Hi, Windows XP, Outlook 2003, Desktop Alert stop popup, When it check in - Tools,Options, Email Options, AdvancedE-mail Options, It supposed to be "Preview" option, its not , In "When new item arrive in my Inbox" all the option mark, But when new mail arrived Desktop Alert not popup, What could be the problem Thank you & Bets Regards, Yakov Do you have a rule set to move messages? If you do then you need to add showing the Desktop Alert to that rule. "Yakov" <Yakov@discussions.microsoft.com> wrote in message news:304C2EEA-5839-47B1-A737-475921A51D...

Power options issue 06-24-10
When I click on Control Panel and then Power Options and set turn off monitor to 20 minutes and turn off hard drive to 20 minutes nothing happens. However if I change those settings to turn off monitor to 1 minute and turn off hard drive to 3 minutes it works every time. I do not know what the problem is or how to correct it, so any help would be greatly appreciated. You should also know that no changes to my system have been made since this problem started happening. The turn off cannot be executed until the computer is not running anything for the amount of time you selec...

Options okn Tools Menu
I have a user who is using Excel 97. When he goes to the menu bar and selects Tools then Options, the Options chioce is there but when you clck on it it does nothing. Has anyone had this issue before and if so how can I get his Options functionality back? Excel and Office has been uninstalled and reinstalled several times. Maybe this is it: XL97: Page Fault or Violation When You Click Options on the Tools Menu http://support.microsoft.com/default.aspx?scid=kb;en-us;108032 sounds like it describes your Tools|Options problem (it says it was corrected in xl97 SR2). Ron Davidson wrote:...

System information using MFC and WMI???
Hi all I have to extract some system information using MFC and WMI. I have extracted some information like Add/Remove Programs, Network, username, computer name, Processor Information, hard disks attached. But for some information i have to use WMI. How i can use the WMI for getting information about system hardware. Please help me by giving sample examples. Thanks and Regards ...

Change printing options based on tender types
I have curerntly setup our POS registers to automotically print 40-column receipts and to prompt the user for whether or not to print a large 80-column invoice. However, I would like to have large invoices automatically print for all charge account tenders. Is there a way to specify the print behavior based on the tender type for the transaction? Thanks, Paul Arenson Anderson Plywood Sales, Culver City, CA not without an add-in. Seems like someone posted something about that within the last few weeks - try searching the newsgroup. -- Glenn Adams Tiber Creek Consulting http://ww...

Adding on Option to an Option Group
I have created a form to give a report of 3 tables and give the user the ability to sort on a column by checking the check box on the header. I had to add another field to one of the tables and now need to add this to the option group.. how? Thanks Sue Found it - for others, you need to add the field to the record source for the form, then with the option group selected, open the field list and drag the new field onto the option group (at least I hope that is it) Sue (Sometimes it actually pays off to have a stack of books over a foot high on Access) "Design by Sue" wrote...

AP Trail Balance should have option to select by due date
I believe the AP Aged Trial Balance could be enhanced to allow to select transactions by a due date range. That way the report will provide a list of invoices that a due within a specific due date range. I have a clinet that has requested this functionality. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click ...

Remove Marketing and Service Option from Left Nav Bar
When the only entity selected in a security role is Account access, we would like the options for Marketing and Service not to be seen in the left hand Nav bar. -- Thanks, Justin ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree" in the message pane. http://www.microsoft.com/Businesssolutio...

Insert options
I've recently been "upgraded" to Office 2010 from Office 2003 and find the "Ribbon" interface really horrible. A good example is in Excel. In Excel 2003 if I wanted to insert a row or column it was simple. Go to the insert menu and select either rows or columns. To do the same task in Excel 2010 the logical place to go is the "Insert" ribbon. This lets me insert lots of things, but none of them are rows or columns. To do that I have to go to the "Home" ribbon and then there is an Insert button from where I can insert rows or columns. I thought one ...

How to revalue an option buttons
Hi, I have option group in from to add values in table. These options use to add a percentage to the table. The first one has 50% labels; the second one has 55% and so on to 100%. The problem is when I retype the value of each option from 1 to 0.50 the value returns to 0. Can any body help me revaluing the value of each option? Thanks!! Check the field type, if its Long or Integer it will round the number and 0.5 will turn into 0. Change the field type to Double or Single -- Good Luck BS"D "Jon" wrote: > Hi, > I have option group in from to add values in table...

No ActiveX for viewing Web Portal
How do people without ActiveX access the web portal? The web portal seems to use ActiveX which is NOT an industry standard and as such locks out our users using alternative browsers. Also, due to the recent JPG Steganography exploit, the javascript exploit, CERT/Dept of Homeland Security telling people to not use IE and Microsoft itself saying to set security levels to the highest setting thus disabling ActiveX, we cannot use ActiveX or view it without becoming vulnerable. This is vitally important especially considering the latest JPG steganography exploit (as well as the continuous ...

data validation
Is it possible to create a similar function like data validation, from which I can select multiple options? (Background: I need a list of many names, from which I case by case can select). Not really. Maybe you could use a listbox. I added a listbox from the Forms toolbar to a worksheet. I called it "List Box 1". I rightclicked on that listbox and chose Format Control. On the Control tab, I chose Selection Type of Multi. I also pointed at the range that held the values that go in that listbox. Then I added a button from the Forms toolbar (I click the button when I'm d...

Validation Options with option List
Good morning! i have set up an validation list option in Excel so i can choose what option to pick. For example, i can choose test1, test2 and/or test3. But what i want to try to do is when i choose one of the options test1,test2 and/or test3 i want for those options different fields like for example: Test1 this is the text of data for test1 When i choose the option Test2 i want the text or data cleared for test1 and see the text for option 2. I hope you can help me with this problem, thanks in advanced! Edo -- EdoZwart ---------------------------------------------------------------...

Problems with Excel Horizontal arrays with regional options using.
Entering a vertical array ={10;20} works ok, but horizontal array ={10,20} gives 10,2 ;-) in both cells instead of 10 and 20 in the two cells. This happens, I presume, because I work with a comma as decimal separator and NOT with the American . I do suppose that Excel has got some solution for this behaviour. I, in principle, do NOT want to change the regional options. ...

6MB msg. stuck in Outbox,tried help method, to cumbersome-ideas?
6MB msg. stuck in Outbox,tried help method, to cumbersome-ideas? "DeLoy" <DeLoy@discussions.microsoft.com> wrote in message news:6D2AC4BE-5044-42D6-8F86-CCE55F79534D@microsoft.com... > 6MB msg. stuck in Outbox,tried help method, to cumbersome-ideas? Click File and check Work Offline. Stop and restart Outlook. Delete the message. Click File and uncheck Work Offline. -- Brian Tillman [MVP-Outlook] ...

Program Name Options
I cannot find the Program Name Options when I select Microsoft Office Button. It is not there. How do I get it? Look in the lower right corner of the block, just inboard of the Exit "X" Richard LeBlanc wrote: > I cannot find the Program Name Options when I select Microsoft Office > Button. It is not there. How do I get it? Thanks "Bob I" <birelan@yahoo.com> wrote in message news:u7UaEj6vKHA.5940@TK2MSFTNGP02.phx.gbl... > Look in the lower right corner of the block, just inboard of the Exit "X" > > Richard LeBlanc wrote...

Second Calendar Option?
Outlook 2000. This is probably a very easy question (I hope). How do I setup a second apptoinment calendar so I can keep my personal appointments seperate from business ones? -- Thanks in advance... Bob File | New | Folder. But if you want to get reminders from the second calendar, you'll need the tool from http://www.slovaktech.com . A better approach might be to use different categories for personal and business appointments and a filtered view. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developer...

SOL_SOCKET Socket Options?
Hello everyone I use the following code to set send timeout and receive timeout for HTTP request but the timeout is about 60 seconds in Windows 98, not 15 seconds which I expect My question is Do Socket Options SO_SNDTIMEO and SO_RCVTIMEO not work in Windows 98 +++++++++++++++++++++++++++++++++ #include "winsock2.h . . m_nSendTimeout=5000 m_nRecvTimeout=10000 . . //set recieve timeou if(setsockopt(sckHTTPSocke ,SOL_SOCKE ,SO_RCVTIME ,(const char *)&m_nRecvTimeou ,sizeof(m_nRecvTimeout))!=0 closesocket(sckHTTPSocket) return //set send timeou...

Activex componet can not create error in Windows Server 2008
We've developed an application in vb6. There are few no.of our own com objects (dlls) and OCXs were referred in this application. This application is working perfectly in all other OS except Windows Server 2008. Here it is showing "Activex components can not create" error. There is no error at the time of registering dlls and ocxs. If anybody have idea about this issue pls help us to solve it. Regards, Rishi Rishi <Rishi@discussions.microsoft.com>'s wild thoughts were released on Tue, 5 Jan 2010 04:16:02 -0800 bearing the following fruit: >We&#...