Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
M

mgriffith

@mgriffith
About
Posts
5
Topics
3
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • add object to listbox
    M mgriffith

    thanks for the reply....i actually was going about it wrong what i'm doing now (to my disguntlement) is keeping an arraylist of my objects in the session collection, and databinding to it...it's working fine i assumed that the ListBox.Items collection would hold objects (as long as they had a tostring() method), but i was wrong. you can, however databind to any object collection/list, as long as the tostring() method is provided, or a datavaluemember and datatextmember are specified michael griffith -------------------- mgriffith@lauren.com mdg12@po.cwru.edu

    Visual Basic com design help

  • add object to listbox
    M mgriffith

    i have created a simple class and want to add it to a listbox using the overloaded tostring() method...i've seen this done in about 10 examples, and straight from msdn, but it's not working for me (using a System.Web.UI.WebControls.ListBox) even with a simple class: ------------------- | Public Class asdf | Public Overrides Function ToString() As String | Return "asdf" | End Function | End Class ------------------- i try to call ------------------- | lstboxMyListBox.Items.Add(new asdf()) ------------------- or even ------------------- | cstr(new asdf()) ------------------- and it won't let it compile because: "Value of Type 'mynamespace.asdf' cannot be converted to 'String'" i then tried this: ------------------- | Public Class asdf | Public Overloads Overrides Property ToString() As String | Get | Return "asdf" | End Get | Set(ByVal Value As String) | | End Set | End Property | End Class ------------------- but i get an error compiling the class because: "'ToString' conflicts with a function by the same name declared in 'Object'" any ideas :~ michael griffith -------------------- mgriffith@lauren.com mdg12@po.cwru.edu

    Visual Basic com design help

  • DataGrid Editing doesn't update
    M mgriffith

    a couple of points... 1. you are using a global sqlconnection....this could hog resources...i'd at least try to close it after every use and reopen it before every use...the datagrid is good at displaying disconnected data (that's that the System.Data.DataSet object is) 2. make sure you aren't calling DataBind() in your page_load event every time, or else it'll grab the data right from sql again should be something like public void page_load() { if (!Page.IsPostBack) { Page.DataBind(); } else { //do nothing...page was posted back, and data will remain in datagrid unless changed in another function } } hope this helps :eek: michael griffith -------------------- mgriffith@lauren.com mdg12@po.cwru.edu

    Web Development question announcement

  • method executing too many times
    M mgriffith

    i just asked this on the visual c++ forum, but i think this is probably a better place to ask....here goes nothing i have 2 methods that are using IWebBrowser2 to execute a print method from a com object that is hosted on a webpage. here is the code for the methods: --------------------------------- STDMETHODIMP CTemplatePrinter::IEPrintNoPrompt(VARIANT varTemplateURL) { CComPtr spContainer; CComPtr spSP; CComPtr spWB; CComPtr spDisp; CComPtr spDoc; CComPtr spCT; CComVariant vPTPath = varTemplateURL; m_spClientSite->GetContainer(&spContainer); spContainer->QueryInterface(IID_IServiceProvider, (void**)&spSP); spSP->QueryService(SID_SWebBrowserApp, IID_IWebBrowser, (void**)&spWB); spWB->get_Document(&spDisp); spDisp->QueryInterface(IID_IHTMLDocument2, (void**)&spDoc); spDoc->QueryInterface(IID_IOleCommandTarget, (void**)&spCT); // ******* THIS IS WHERE IT'S GOING CRAZY!!!! ******* // spCT->Exec(&CGID_MSHTML, IDM_PRINT, OLECMDEXECOPT_DONTPROMPTUSER, &vPTPath, NULL); return S_OK; } --------------------------------------- STDMETHODIMP CTemplatePrinter::IEPrint(VARIANT varTemplateURL) { CComPtr spContainer; CComPtr spSP; CComPtr spWB; CComPtr spDisp; CComPtr spDoc; CComPtr spCT; CComVariant vPTPath = varTemplateURL; m_spClientSite->GetContainer(&spContainer); spContainer->QueryInterface(IID_IServiceProvider, (void**)&spSP); spSP->QueryService(SID_SWebBrowserApp, IID_IWebBrowser, (void**)&spWB); spWB->get_Document(&spDisp); spDisp->QueryInterface(IID_IHTMLDocument2, (void**)&spDoc); spDoc->QueryInterface(IID_IOleCommandTarget, (void**)&spCT); // ***** IT CALLS THIS 2 TIMES? ******** // spCT->Exec(&CGID_MSHTML, IDM_PRINT, OLECMDEXECOPT_PROMPTUSER, &vPTPath, NULL); return S_OK; } -------------------------- my question is: does anyone have any idea why the IOleCommandTarget::Exec method it going berzerk? when i call the method from a script, the first one keeps spooling pages into the printer, and the second one opens 2 print dialogs in a row...i also have another function for opening a print preview window that works fine....the only difference is my call to Exec is as follows: spCT->Exec(&CGID_MSHTML, IDM_PRINTPREVIEW, OLECMDEXE

    COM c++ question com tools

  • method executing too many times
    M mgriffith

    i have 2 methods that are using IWebBrowser2 to execute a print method from a com object that is hosted on a webpage. here is the code for the methods: --------------------------------- STDMETHODIMP CTemplatePrinter::IEPrintNoPrompt(VARIANT varTemplateURL) { CComPtr spContainer; CComPtr spSP; CComPtr spWB; CComPtr spDisp; CComPtr spDoc; CComPtr spCT; CComVariant vPTPath = varTemplateURL; m_spClientSite->GetContainer(&spContainer); spContainer->QueryInterface(IID_IServiceProvider, (void**)&spSP); spSP->QueryService(SID_SWebBrowserApp, IID_IWebBrowser, (void**)&spWB); spWB->get_Document(&spDisp); spDisp->QueryInterface(IID_IHTMLDocument2, (void**)&spDoc); spDoc->QueryInterface(IID_IOleCommandTarget, (void**)&spCT); // ******* THIS IS WHERE IT'S GOING CRAZY!!!! ******* // spCT->Exec(&CGID_MSHTML, IDM_PRINT, OLECMDEXECOPT_DONTPROMPTUSER, &vPTPath, NULL); return S_OK; } --------------------------------------- STDMETHODIMP CTemplatePrinter::IEPrint(VARIANT varTemplateURL) { CComPtr spContainer; CComPtr spSP; CComPtr spWB; CComPtr spDisp; CComPtr spDoc; CComPtr spCT; CComVariant vPTPath = varTemplateURL; m_spClientSite->GetContainer(&spContainer); spContainer->QueryInterface(IID_IServiceProvider, (void**)&spSP); spSP->QueryService(SID_SWebBrowserApp, IID_IWebBrowser, (void**)&spWB); spWB->get_Document(&spDisp); spDisp->QueryInterface(IID_IHTMLDocument2, (void**)&spDoc); spDoc->QueryInterface(IID_IOleCommandTarget, (void**)&spCT); // ***** IT CALLS THIS 2 TIMES? ******** // spCT->Exec(&CGID_MSHTML, IDM_PRINT, OLECMDEXECOPT_PROMPTUSER, &vPTPath, NULL); return S_OK; } -------------------------- my question is: does anyone have any idea why the IOleCommandTarget::Exec method it going berzerk? when i call the method from a script, the first one keeps spooling pages into the printer, and the second one opens 2 print dialogs in a row...i also have another function for opening a print preview window that works fine....the only difference is my call to Exec is as follows: spCT->Exec(&CGID_MSHTML, IDM_PRINTPREVIEW, OLECMDEXECOPT_PROMPTUSER, &vPTPath, NULL); i've tried all that i can see...if i replace spCT->Exec(...) with spWB->ExecWB(

    C / C++ / MFC question com tools
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups