Search Results

Search found 8446 results on 338 pages for 'dynamic cast'.

Page 98/338 | < Previous Page | 94 95 96 97 98 99 100 101 102 103 104 105  | Next Page >

  • Zipping increment file names using Zip Utils

    - by Peter
    Hello I've been using "Zip Utils" from http://www.codeproject.com/Articles/7530/Zip-Utils-clean-elegant-simple-C-Win32 to zip files and folders. the easy thing is if the file name is known i just need to do something like this HZIP hz; DWORD writ; hz = CreateZip(_T("filename\\image1.zip"),0); The problem is I get errors when trying to zip files by incrementing file names within a loop int i= 0; for(i=0; i<record; i++) { ZipAdd(hz,_T("doc"+i+1+".kml"), _T("filename\\doc"+i+1+".kml")); }

    Read the article

  • Adding items in the combobox dynamically.

    - by Harikrishna
    Can we add the items in the combobox located on the window form dynamically ? Like there are 7 combobox on the window form and when the application is run user should be able to add the item(s) in the combobox.And items added by user should be permanent in the combobox.

    Read the article

  • Is the a pattern for iterating over lists held by a class (dynamicly typed OO languages)

    - by Roman A. Taycher
    If I have a class that holds one or several lists is it better to allow other classes to fetch those lists(with a getter) or to implement a doXList/eachXList type method for that list that take a function and call that function on each element of the list contained by that object. I wrote a program that did a ton of this and I hated passing around all these lists sometimes with method in class a calling method in class B to return lists contained in class C, B contains a C or multiple C's (note question is about dynamically typed OO languages languages like ruby or smalltalk) ex. (that came up in my program) on a Person class containing scheduling preferences and a scheduler class needing to access them.

    Read the article

  • how to get child members value from dynamically casted class?

    - by Baka-Maru Lama
    Well I'm tring to get class members values from a dynamically casted class but I'm unable to find its child class members values. Right now I'm getting TotalWeight members property, but I also want to get child member property of AnotherClass like AnotherClass.child. How can I get those members? string ClassName="something"; Type types = Type.GetType(ClassName, false); var d = from source in types.GetMembers().ToList() where source.MemberType == MemberTypes.Property select source; List<MemberInfo> members = d.Where(memberInfo => d.Select(c => c.Name) .ToList() .Contains(memberInfo.Name)) .ToList(); PropertyInfo propertyInfo; object value; foreach (var memberInfo in members) { propertyInfo = typeof(T).GetProperty(memberInfo.Name); if (myobj.GetType().GetProperty(memberInfo.Name) != null) { value = myobj.GetType() .GetProperty(memberInfo.Name) .GetValue(myobj, null); //how to get child members value here? } } //Where class something has member public class something { private decimal _totalWeight; private Anotherclass _another; public decimal TotalWeight { get { return this._totalWeight; } set { this._totalWeight = value; } } public Anotherclass Another { get { return this._another; } set { this._another= value; } } }

    Read the article

  • Problem with events and ParseControl

    - by Richard Edwards
    I'm adding a control (linkbutton) dynamically using ParseControl and it's fine except when I specify an event handler. If I use: Dim c As Control = ParseControl("<asp:LinkButton id=""btnHide"" runat=""server"" text=""Hide"" OnClick="btnHide_Click" />") it correctly adds the control to the page but the click event doesn't fire. If instead I find the control in the controls collection and manually wire up the event it works fine. I've tried loading in both Page_Init and Page_Load and it's the same thing either way. Any ideas?

    Read the article

  • Modifying CSS class property values on the fly with JavaScript / jQuery

    - by JPN
    all. I've run into a unique situation that I have so far been unable to find a solution for: dynamically assigning a value to a CSS style. I know how to use jQuery to assign width, height, etc. to an element, but what I'm trying to do is actually change the value defined in the stylesheet so that the dynamically-created value can be assigned to multiple elements. What I'm building is a slideshow of images that occupy the full viewport, recalculating the image's width, height, and left properties on resize so that the image is always centered, favors width over height, except when the viewport is taller than it is wide (resizing does not reload the page, just fires a function to resize the image). I have successfully been able to get it to work on one image, and now I'm trying to determine the best way to assign those property values to all images in the slideshow without having to specify those three things individually for every image. Can the values of properties in a class be modified on the fly? I'm sure the answer is out there, I'm probably just not using the correct terminology in my searches. Hope I did a good job of describing the problem. TIA.

    Read the article

  • innerHTML of dynamically added element not updating in Chrome

    - by Sara Chipps
    I'm modifying a dynamically created input element by setting the innerHTML, when I view the element in the DOM Inspector I can see that the values I passed are in the input. However, I can't see it on the page? Is there a refresh() function that I should be calling after setting the value? I have tried innerText, and value and gotten the same results. Here is how I am setting it: $("input[name='group']")[0].innerHTML = groups; (as far as the JS set and the JQuery selector I have found chrome plugins to be fickle this way)

    Read the article

  • Ext JS 4.2.1 loading controller - best practice

    - by Hown_
    I am currently developing a Ext JS application with many views/controlers/... I am wondering myself what the best practice is for loading the JS controllers/views/and so on... currently i have my application defined like this: // enable javascript cache for debugging, otherwise Chrome breakpoints are lost Ext.Loader.setConfig({ disableCaching: false }); Ext.require('Ext.util.History'); Ext.require('app.Sitemap'); Ext.require('app.Error'); Ext.define('app.Application', { name: 'app', extend: 'Ext.app.Application', views: [ // TODO: add views here 'app.view.Viewport', 'app.view.BaseMain', 'app.view.Main', 'app.view.ApplicationHeader', //administration 'app.view.administration.User' ... ], controllers: [ 'app.controller.Viewport', 'app.controller.Main', 'app.controller.ApplicationHeader', //administration 'app.controller.administration.User', ... ], stores: [ // stores in there.. ] }); somehow this forces the client to load all my views and controllers at startup and is calling all init methods of all controllers of course.. i need to load data everytime i chnage my view.. and now i cant load it in my controllers init function. I would have to do something like this i assume: init: function () { this.control({ '#administration_User': { afterrender: this.onAfterRender } }); }, Is there a better way to do this? Or just an other event? Though the main thing i am questioning myself is if it is the best practice to load all the javascript at startup. Wouldnt it be better to only load the controllers/views/... which the client does need right now? Or should i load all the JS at startup? If i do want to load the controllers dynamicly how could i do this? I assume a would have to remove them from my application arrays (views, controllers, stores) and create an instance if i do need it and mby set the view in the controllers init?! What's best practice??

    Read the article

  • C++ delete[] operator

    - by Betamoo
    Is this the right way to use delete[] operator? int* a=new int[size]; delete[] a; If yes, Who (compiler or GC or whoever) will determine the size of the newly created array? and where will it store the array size? Thanks

    Read the article

  • DynamicJasper(on Grails) Purposefully keep column or field blank(empty)

    - by petejoe
    Hi, I want to generate a pdf report, where a column(or cell/field) is left blank(empty) on purpose. This column actually does have a value but, I'm choosing not to display it. The column title still needs to be displayed. Example of where this could be useful: Blank(empty) column: A comments or notes column down one side of a report. Blank(empty) cell: A sudoku puzzle print-out. Much appreciated. DynamicJasper is Awesome! Thanks to the dj-team. Regards, Pete

    Read the article

  • Making Visual C++ DLL from C++ class

    - by prosseek
    I have the following C++ code to make dll (Visual Studio 2010). class Shape { public: Shape() { nshapes++; } virtual ~Shape() { nshapes--; }; double x, y; void move(double dx, double dy); virtual double area(void) = 0; virtual double perimeter(void) = 0; static int nshapes; }; class __declspec(dllexport) Circle : public Shape { private: double radius; public: Circle(double r) : radius(r) { }; virtual double area(void); virtual double perimeter(void); }; class __declspec(dllexport) Square : public Shape { private: double width; public: Square(double w) : width(w) { }; virtual double area(void); virtual double perimeter(void); }; I have the __declspec, class __declspec(dllexport) Circle I could build a dll with the following command CL.exe /c example.cxx link.exe /OUT:"example.dll" /DLL example.obj When I tried to use the library, Square* square; square->area() I got the error messages. What's wrong or missing? example_unittest.obj : error LNK2001: unresolved external symbol "public: virtual double __thiscall ... Square::area(void)" (?area@Square@@UAENXZ) ADDED Following wengseng's answer, I modified the header file, and for DLL C++ code, I added #define XYZLIBRARY_EXPORT However, I still got errors. example_unittest.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __th iscall Circle::Circle(double)" (__imp_??0Circle@@QAE@N@Z) referenced in function "protected: virtual void __thiscall TestOne::SetUp(void)" (?SetUp@TestOne@@MAEXXZ) example_unittest.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __th iscall Square::Square(double)" (__imp_??0Square@@QAE@N@Z) referenced in function "protected: virtual void __thiscall TestOne::SetUp(void)" (?SetUp@TestOne@@MAEXXZ) example_unittest.obj : error LNK2001: unresolved external symbol "public: virtual double __thiscall Square::area(void)" (?area@Square@@UAENXZ) example_unittest.obj : error LNK2001: unresolved external symbol "public: virtual double __thiscall Square::perimeter(void)" (?perimeter@Square@@UAENXZ) example_unittest.obj : error LNK2001: unresolved external symbol "public: virtual double __thiscall Circle::area(void)" (?area@Circle@@UAENXZ) example_unittest.obj : error LNK2001: unresolved external symbol "public: virtual double __thiscall Circle::perimeter(void)" (?perimeter@Circle@@UAENXZ)

    Read the article

  • Gridview changing text in a button column

    - by Bob Avallone
    I am working in asp.net using the gridview control. I have a button column that I create dynamically as such: ButtonField bfSelect = new ButtonField(); bfSelect.HeaderText = "View"; bfSelect.ButtonType = ButtonType.Link; bfSelect.CommandName = "View"; bfSelect.Text = "View"; grdAttachments.Columns.Add(bfSelect); The text on the button is the same for every row. I was wondering if there was any way to have the text be different for different rows depending on a condition. When I try to look at the text property of a particular row it is blank, if I try to set it, it does not change. Thanks in advance. Bob

    Read the article

  • vb.net add text to form without interaction

    - by user228058
    I have a winform project which lists all the files in a specified folder. It allows the user to select a new destination for each file, and when the user has chosen the destinations for all files that he would like to be moved, it moves the files, one by one. My next step is, I need to display a confirm form when the files are being moved, and add each file's name and destination to the confirm form as it is being moved. My question is: How can I add more text to the confirm form's controls after I already loaded it (using confirm.showdialog() from my other form, without any user interaction? I imagine that I need to do it from the original form, because it needs to display each one when it starts to move that file, but I'm open to any suggestions:) TIA

    Read the article

  • How do I dynamically assign the Model for a .find in Ruby on Rails?

    - by Angela
    I am trying to create a Single Table Inheritance. However, the Controller must be able to know which class to find or create. These are based on another class. For example, ContactEvent with type = Letter needs to grab attributes from a corresponding Model called Letter. Here's what I've tried to do and hit a snag, labelled below. I need to be able to dynamically call assign a value of EventClass so that it can be Letter.find(:conditions =) or Calls.find(:conditions =) depending on which type the controller is acting on. def new @contact_event = ContactEvent.new @contact_event.type = params[:event_type] # can be letter, call, postcard, email @contact_event.event_id = params[:event_id] # that ID to the corresponding Model @contact_event.contact_id = params[:contact] @EventClass = case when @contact_event.type == 'letter' then 'Letter' when @contact_event.type == 'call' then 'Call' when @contact_event.type == 'email' then 'Email' SNAG BELOW: @event = @EventClass.find(@contact_letter.letter_id) #how do I make @EventClass actually the Class?SNAG # substitution of variables into the body of the contact_event @event.body.gsub!("{FirstName}", @contact.first_name) @event.body.gsub!("{Company}", @contact.company_name) @evebt.body.gsub!("{Colleagues}", @colleagues.to_sentence) @contact_event.body = @event.body @contact_event.status = "sent" end

    Read the article

  • SWF (using XML) only working locally, not on home server or web hosting server

    - by Andy
    Hi, I use a main SWF file, which has some animations. It uses xml from a .php file which specifies several items, e.g. images and other SWFs to be used in the main SWF. Locally everything works perfectly, but when invoking it via my home server, or hosting provider it doesn't work anymore and I don't get why. All links are relative and correct. Somehow the main SWF doesn't load fully, or has problems with the XML from the .php file. I'm not sure, now I only get a black box that doesn't show any of the other content it's supposed to. check it out: http://deoshermes.ath.cx/cc-common/templates/dynamiclead/dynamic_leadee.swf the XML: <?xml version="1.0" ?><dynamic_content> <item blurb="Text 1" content_url="" content_source="" content_timer="8000" content_target="_self" tab_color="0x000000" tab_border_color="0x000000" tab_arrow_color="0xFFFFFF" tab_text_color="0xFFFFFF" tab_image="/template/images/dle_TOPmay06.jpg" cycle="true" content_border_color="0x" content_bg_image="" tab_hl_color="0x000000" tab_highlight_color="0x" tab_highlight_text_color="0x" tab_highlight_image="" > </item> <item blurb="Text 2" content_timer="5000" cycle="true" content_border_color="0x" content_bg_image="" tab_hl_color="0xFFFFFF" tab_border_color="0xFFFFFF" tab_color="0xFFFFFF" tab_arrow_color="0xFFFFFF" tab_text_color="0xFFFFFF" tab_image="/template/images/dle_MIDandBOTmay06.jpg" tab_highlight_color="0x" tab_highlight_text_color="0x" tab_highlight_image="" content_url="" content_source="" content_target="_self" > </item> <item blurb="Text 3" content_timer="5000" cycle="true" content_border_color="0x" content_bg_image="" tab_hl_color="0xFFFFFF" tab_border_color="0xFFFFFF" tab_color="0xFFFFFF" tab_arrow_color="0xFFFFFF" tab_text_color="0xFFFFFF" tab_image="/template/images/dle_MIDandBOTmay06.jpg" tab_highlight_color="0x" tab_highlight_text_color="0x" tab_highlight_image="" content_url="" content_source="" content_target="_self" > </item> </dynamic_content> this works like a charm when invoking the main SWF locally. The ActionScript from the main sWF can be found at samedomain as above/Actionscript_mainmovie.txt This also seems to work great. the function formattabs (line 68) uses some javascript. Locally the main SWF functions even without this hbx file which is located /cc-common/wss/hbx.js and use in the webpage actually. I haven't got a clue what's keeping the main SWF from working properly, because all other single SWFs work properly when invoked using a direct link. And this one just isn't working... Do I maybe need to add something in the php.ini file?? Any help would be appreciated!

    Read the article

  • GDI: Dynamical Multiple Graphics in a page?

    - by SirLenz0rlot
    Hi all, I'm quite new to drawing shapes, graphics, bitmaps etc. I googled for a few days,but still havent got a real clue what to do, so please help me: I want to draw a floorplan with certain objects(represented as circles) moving on it. When I click on a object, it needs to show something. So far, I ve been able to draw some circles on a graphic and been able to move the dots by clearing the graphic every time. Ofcourse, this isnt a real solution, since I cant keep track of the different objects on the floorplan (which i need for my clickevent and movings). I hope I explained my problem ok here. This is the (stripped version of the) sourcecode that gets called every second: (dev (of type Device) is the object i want to draw) Graphics gfx = FloorplanTabPage.CreateGraphics(); gfx.Clear(Color.White); foreach (Device dev in _deviceList) { Pen myPen = new Pen(Color.Black) { Width = 10 }; dev.InRoom != null) { myPen.Color = Color.DarkOrchid; int x = dev.InRoom.XPos + (dev.InRoom.Width / 2) - 5; int y = (dev.InRoom.YPos + (dev.InRoom.Height / 2) - 5; if (dev.ToRoom != null) { x = (x + (dev.ToRoom.XPos + (dev.ToRoom.Width / 2)) / 2; y = (y + (dev.ToRoom.YPos + (dev.ToRoom.Height / 2)) / 2; } gfx.DrawEllipse(myPen, x, y, 10, 10); gfx.DrawString(dev.Name, new Font("Arial", 10), Brushes.Purple, x, y - 15); } }

    Read the article

  • persist values/variables from page to page

    - by Todd
    Hello, I'm wondering if there's another solution to my problem, that's considered more the Sharepoint way. FIrstly, my site is an Internet site, not Intranet. The problem is, all I'm trying to do is save values/variables from page to page in Sharepoint. I know the issue with Session Variables, but this seems to be the only way I can see to accomplish this. I know there are webparts that can store this value, but am I wrong in thinking this won't be persisted from page to page? Basically, I'll be extending the Content Query Web Part to dynamically filter it's results based off of a variable/value. The user chooses their 'area' from a dropdown, and the CQWP in the site will change and query results based off of this value (It will be a provincial structure as it is a Canadian site, so if someone chooses the province 'Ontario', this value is saved in a global variable, and these extended CQWP that are throughout the site, will get this value, and query lists flagged as Ontario). Is Session variables the only solution? Thanks everyone!

    Read the article

  • Dynamically generating high performance functions in clojure

    - by mikera
    I'm trying to use Clojure to dynamically generate functions that can be applied to large volumes of data - i.e. a requirement is that the functions be compiled to bytecode in order to execute fast, but their specification is not known until run time. e.g. suppose I specify functions with a simple DSL like: (def my-spec [:add [:multiply 2 :param0] 3]) I would like to create a function compile-spec such that: (compile-spec my-spec) Would return a compiled function of one parameter x that returns 2x+3. What is the best way to do this in Clojure?

    Read the article

< Previous Page | 94 95 96 97 98 99 100 101 102 103 104 105  | Next Page >