Search Results

Search found 3592 results on 144 pages for 'pointer'.

Page 104/144 | < Previous Page | 100 101 102 103 104 105 106 107 108 109 110 111  | Next Page >

  • Help with implementing a function to change size of dynamic array

    - by iRobot
    I'm trying to write a function that will change the size of a dynamic array to a new size. In my header file, I have: Image **images; //pointer to a dynamic array of image pointers int maximum; //size I want to do this by allocating a new array and copying the values over without changing their indices. If there are non-null pointers outside the range newmax, then we cant do this. So heres what I have: There are no compilation or runtime errors. However, I find that the new array isnt getting sized right. When I run the following test case: I should get an index out of bounds error, but instead the system lets it slide. Can anyone see the mistake? I've looked for hours but cant find anything.

    Read the article

  • seg violation using pycapsule_new

    - by user1733051
    I am trying some simple c API, where I am using PyCapsule_New to encapsulate a pointer. I am running into segment violation, can some body help me. mystruct *func1(int streamno, char mode,unsigned int options) { char * s; s=malloc(100); return s; } PyObject *Wrapper_func1(PyObject *self, PyObject *args) { int streamno; char mode; unsigned int options; mystruct* result; if (!PyArg_ParseTuple(args,"icI",&streamno,&mode,&options)) return NULL; result = func1(streamno,mode,options); return PyCapsule_New( result,NULL,NULL); }

    Read the article

  • Are unspecified and undefined behavior required to be consistent between compiles?

    - by sharptooth
    Let's pretend my program contains a specific construct the C++ Standard states to be unspecified behavior. This basically means the implementation has to do something reasonable but is allowed not to document it. But is the implementation required to produce the same behavior every time it compiles a specific construct with unspecified behavior or is it allowed to produce different behavior in different compiles? What about undefined behavior? Let's pretend my program contains a construct that is UB according to the Standard. The implementation is allowed to exhibit any behavior. But can this behavior differ between compiles of the same program on the same compiler with same settings in the same environment? In other words, if I dereference a null pointer on line 78 in file X.cpp and the implementation formats the drive in such case does it mean that it will do the same after the program is recompiled?

    Read the article

  • between syntax, are there any equal function

    - by gcc
    /* char **mainp=malloc(sizeof(char *)*2); mainp[0]=malloc(sizeof(char)*300); mainp[1]=malloc(sizeof(char )*300); */ *I have some input about propositional calculus *After calculating some math funtion-removing paranthesis-changing"&" with ","-replacing "|" with"," I have >> (1) P,-Q,Q,-R is stored in mainp[0] R,A,P,B,F is stored in mainp[1] *My question is: Between comma , I have want to compare two pointer array. If there is any equal two or more functions(Q,-R is function representation) ,function which you will show me how to write must return int. According to example (1),function will return 1 (I expect like that) /*I have som thought://which function should I have use:*/ in for loop if( strspn(mainp[0][i])==1 ) increment d; continue; or in for loop srtcmp(mainp[0][i],mainp[1]);

    Read the article

  • Shift from Java to c++

    - by zengr
    Hello, I have been developing applications based on C# (.net) and Java (J2EE) from the last 3 years. But, now I feel, Java, C# makes you lame (from learning point of view) and you can develop your apps quickly but you fail to understand the basic underlying concepts of programming. So, I am trying to learn C++, but I find it a little "confusing" due to pointer, multiple inheritance, some conventions and other concepts of C++ which don't exist in Java. So, what do you guys suggest? How should I got about it? Thanks PS: I am a student, so have all the time in the world and actually shift.

    Read the article

  • C++, is it possible to obtain the dimension of an array?

    - by aaa
    hi. Suppose I have some pointer, which I want to reinterpret as static dimension array reference: double *p; double (&r)[4] = ?(p); // some construct? // clarify template< size_t N> void function(double (&a)[N]); ... double *p; function(p); // this will not work. // I would like to cast p as to make it appear as double[N] Is it possible to do so? how do I do it?

    Read the article

  • Why is this simple hello world code segfaulting?

    - by socks
    Excuse the beginner level of this question. I have the following simple code, but it does not seem to run. It gets a segmentation fault. If I replace the pointer with a simple call to the actual variable, it runs fine... I'm not sure why. struct node { int x; struct node *left; struct node *right; }; int main() { struct node *root; root->x = 42; printf("Hello world. %d", root->x); getchar(); return 0; } What is wrong with this code?

    Read the article

  • Abstract class and operator!= in c++

    - by Alessandro Teruzzi
    Hi All, I have problem implementing the operator!= in a set class deriving from an abstact one. The code looks like this: class Abstract { public: //to make the syntax easier let's use a raw pointer virtual bool operator!=(const Abstract* other) = 0; }; class Implementation { SomeObject impl_; //that already implement the operator!= public: bool operator!=(const Abstract* other) { return dynamic_cast<Implementation*>(other)->impl_ != this->impl_; } }; This code works but it has the drawback to use dynamic_cast and I need to handle error in casting operation. This is a generic problem that occur when a function of a concrete class it is trying to using some internal information (not available at the abstract class level) to perform a task. Is there any better way to solve this kind of problem? Cheers

    Read the article

  • How to do hex8 encoding in c?

    - by Tech163
    I am trying to encode a string in hex8 using c. The script I have right now is: int hex8 (char str) { str = printf("%x", str); if(strlen(str) == 1) { return printf("%s", "0", str); } else { return str; } } In this function, I will need to add a 0 ahead of the string if the length is less than 1. I don't know why I'm getting: passing argument 1 of 'strlen' makes pointer from integer without a cast Does anyone know why?

    Read the article

  • memcpy does not copy the data

    - by user437777
    I am caught up with a weird problem. I have one build that copies data using memcpy, while another build does not. I don't understand why, because the relevant file is still the same. I am using following code: memcpy(pxCurrentInfo, &pxInfoBuffer->axgInfoBuffer[0], sizeof(tInfo)); Data in pxInfoBuffer is fine. When I check pxCurrentInfo they are all 0s. tInfo is a structure. To give a pointer, when I put the break point and change the value pxCurrentInfo->xDL.eMethod=0 it automatically updates/copies all the correct info from pxInfoBuffer->axgInfoBuffer[0], afterwards. I don't know why.

    Read the article

  • [C++] Passing around objects to network packet handlers ?

    - by xeross
    Hey, I've been writing a networking server for a while now in C++ and have come to the stage to start looking for a way to properly and easily handle all packets. I am so far that I can figure out what kind of packet it is, but now I need to figure out how to get the needed data to the handler functions. I had the following in mind: Have a map of function pointers with the opcode as key and the function pointer as value Have all these functions have 2 arguments, packet and ObjectAccessor ObjectAccessor class contains various functions to fetch various items such as users and alike Perhaps pass the user's guid too so we can fetch it from the objectaccessor I'd like to know the various implementations others have come up with, so please comment on this idea and reply with your own implementations. Thanks, Xeross

    Read the article

  • lua function as argument in C

    - by Nil
    I'm going to pass a function to another function which should operate with the passed function. For example: handler(fun1("foo",2)) handler(fun2(1e-10)) The handler is something like calling the passed function many times. I'm going to bind handler, fun1, fun2 to C-functions. fun1 and fun2 are going to return some user data with a pointer to some cpp-class so that I can further recover which function was it. The problem now is that fun1 and fun2 are going to be called before passed to handler. But I don't need this, what I need is the kind of function and its parameters. However, I should be able to call fun1 and fun2 alone without handler: fun1("bar",3) fun2(1e-5) Is it possible to get the context the function is called from? While typing the question, I realized I could do following handler(fun1, "foo",2); handler(fun2, 1e-10);

    Read the article

  • What does DetourAttach(&(PVOID &)BindKeyT, BindKeyD); mean? Attaching a detour to a memory address..

    - by user288546
    Hello everyone! This is just a simple question. I've been reading the source of something which attaches to a memory address of a subroutine using DetourAttach(&(PVOID &)BindKeyT, BindKeyD); where BindKeyT is the address to a subroutine in memory. I'm curious, what exactly does (&(PVOID &) mean in english? I understand that PVOID is a void pointer, but how does this get translated into a function which can be used to attach a detour to?

    Read the article

  • Any efficient way to read datas from large binary file?

    - by limi
    Hi, I need to handle tens of Gigabytes data in one binary file. Each record in the data file is variable length. So the file is like: <len1><data1><len2><data2>..........<lenN><dataN> The data contains integer, pointer, double value and so on. I found python can not even handle this situation. There is no problem if I read the whole file in memory. It's fast. But it seems the struct package is not good at performance. It almost stuck on unpack the bytes. Any help is appreciated. Thanks.

    Read the article

  • realizing number ...how?? [closed]

    - by gcc
    i hold input like that A is char pointer A[0]=n A[1]=j A[2]=n A[3]=d . there is one number in A[] and every A[i] is important for me because what will i do in next step is determined by input in A[i] or A[n] A[j]=$ . A[i]=14(any number) . . int func(int temp) { if(temp=='n') ..do something then return 10; if(temp=='j') .. return 11; if(temp=='d') .. return 12; if(........) when temp find/realize number ,i wanna return 13; in if statement, what code should i write } how i can do }

    Read the article

  • when i refresh the page, the popup window is visible for a second. How to clear this issue

    - by mano
    script $(document).ready(function(){ $(".aboutBtn").click(function () { $(".aboutContent").slideToggle("slow"); }); $(".contact").click(function () { $(".aboutContent").slideToggle("slow"); }); }); *Html * <article class="aboutBtn">ABOUT</article> Css .aboutBtn{ width:85px; padding:5px 0px 5px 10px; background-color:#d8531e; cursor:pointer; color:#ffffff; font-size:20px; text-transform:uppercase; position:relative;top:-48px; font-family:"Segoe UI Light"; }

    Read the article

  • trying to hide options from selectlist .. not working on chrome and ie

    - by ninja
    Hi, I have a select lists, which has lots of option. Depending on some input I want to hide few options from select list. To hide options from select list I have written jquery like $('#selectlist1 option').each(function(){ $(this).hide(); }) But this code seems to work only for firefox and its not working on chrome and ie. Whereas if I write $('#selectlist1').hide(); it works for all browser. Any pointer where should I look at?

    Read the article

  • trying to hide options from selectlist .. not working on chrom and ie

    - by ninja
    Hi, I have a select lists, which has lots of option. Depending on some input I want to hide few options from select list. To hide options from select list I have written jquery like $('#selectlist1 option').each(function(){ $(this).hide(); }) But this code seems to work only for firefox and its not working on chrom and ie. Whereas if I write $('#selectlist1').hide(); it works for all browser. Any pointer where should I look at?

    Read the article

  • javascript popup image

    - by sam
    folks., i need to popup image on image hover?the image should be placed just above mouse pointer? i tried to implement event.x,event.y.. but it is not positoning well in all browsers..?is css need to be used here or please give me javascript code.. Code sample function Large(obj,id,e) { var imgbox=document.getElementById("imgbox"); // this is div tag,inside div i am placing imagebutton.. var imgbtn=document.getElementById('<%=ImageButton3.ClientID%>'); imgbox.style.visibility='visible'; imgbtn.src=obj; imgbox.style.left=event.x; imgbox.style.top= event.y; } thank you

    Read the article

  • Input Iterator for a shared_ptr

    - by Baz
    I have an iterator which contains the following functions: ... T &operator*() { return *_i; } std::shared_ptr<T> operator->() { return _i; } private: std::shared_ptr<T> _i; ... How do I get a shared pointer to the internally stored _i? std::shared_ptr<Type> item = ??? Should I do: MyInterfaceIterator<Type> i; std::shared_ptr<Type> item = i.operator->(); Or should I rewrite operator*()?

    Read the article

  • *(char**) how to understand this construct?

    - by House.Lee
    recently, while reading former's code in my current project, I encounter the problems below: while implementing the Queue, my former wrote codes like this: while(uq->pHead) { char *tmp = uq->pHead; uq->pHead = *(char **)tmp; //... } the uq-pHead has definition like: typedef struct { char* pHead; //... } Queue; Well, I'm quite confused about the usage that "uq->pHead = *(char**)tmp" , could anyone explain it to me in detail? if we assume that *(uq-pHead) = 32(i.e. ' ') , *(char**)tmp would translate this into pointer-form, but...how could it make sense? Thanks a lot.

    Read the article

  • how to form an array of numbers , taken input from a file in C

    - by mekasperasky
    The program should be able to make an array of numbers from a text file which reads like this The data is given as this 123 2132 1100909 3213 89890 my code for it is char a; char d[100]; char array[100]; a=fgetc(fp) // where fp is a file pointer if (a=='') { d[count1]='/0'; strcpy(&array[count],d); count=count+1; memset(d,'\0',100) count1=0; } else { d[count1]=a; count1=count1+1; } a=fgetc(fp);

    Read the article

  • referencing struct fields in c with square brackets and an index instead of . and ->?

    - by lsiebert
    Assuming I have a structure such as: typedef struct { char * string1; char * string2; } TWO_WORDS; such that all the fields are of the same type, and my main has TWO_WORDS tw; can I reference string1 with tw[0] and string2 with two[1]? If so: is this part of the c standard? do i have to cast the struct to an array first? what about fields which are different sizes in memory what about fields which are different types but the same size? can you do pointer arithmetic within a structure? -

    Read the article

  • Retrieve data like rework %, schedule and effort varience from Microsoft Project

    - by Ram
    Hi, I need to generate various metric from my MS project file for the period of one month. I need to generate following reports Schedule Variance Effort Variance Rework Percentage Wasted Efforts For rework percentage, I am using condition like the task.Start date should be greater than or equal to the start date and task.Finish date should be less than or equal to finish date. but I am concerned about the tasks those are starting before the start date and ending before the end date. In such situation I only need the rework % for the number of hrs spent during start and end and not for the hrs spent before start date. Same thing applies to the task which are starting before end date but ending after end date. Any pointer would be great help. Thanks

    Read the article

  • Integrating HTML into Silverlight Applications

    - by dwahlin
    Looking for a way to display HTML content within a Silverlight application? If you haven’t tried doing that before it can be challenging at first until you know a few tricks of the trade.  Being able to display HTML is especially handy when you’re required to display RSS feeds (with embedded HTML), SQL Server Reporting Services reports, PDF files (not actually HTML – but the techniques discussed will work), or other HTML content.  In this post I'll discuss three options for displaying HTML content in Silverlight applications and describe how my company is using these techniques in client applications. Displaying HTML Overlays If you need to display HTML over a Silverlight application (such as an RSS feed containing HTML data in it) you’ll need to set the Silverlight control’s windowless parameter to true. This can be done using the object tag as shown next: <object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%"> <param name="source" value="ClientBin/HTMLAndSilverlight.xap"/> <param name="onError" value="onSilverlightError" /> <param name="background" value="white" /> <param name="minRuntimeVersion" value="4.0.50401.0" /> <param name="autoUpgrade" value="true" /> <param name="windowless" value="true" /> <a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=4.0.50401.0" style="text-decoration:none"> <img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight" style="border-style:none"/> </a> </object> By setting the control to “windowless” you can overlay HTML objects by using absolute positioning and other CSS techniques. Keep in mind that on Windows machines the windowless setting can result in a performance hit when complex animations or HD video are running since the plug-in content is displayed directly by the browser window. It goes without saying that you should only set windowless to true when you really need the functionality it offers. For example, if I want to display my blog’s RSS content on top of a Silverlight application I could set windowless to true and create a user control that grabbed the content and output it using a DataList control: <style type="text/css"> a {text-decoration:none;font-weight:bold;font-size:14pt;} </style> <div style="margin-top:10px; margin-left:10px;margin-right:5px;"> <asp:DataList ID="RSSDataList" runat="server" DataSourceID="RSSDataSource"> <ItemTemplate> <a href='<%# XPath("link") %>'><%# XPath("title") %></a> <br /> <%# XPath("description") %> <br /> </ItemTemplate> </asp:DataList> <asp:XmlDataSource ID="RSSDataSource" DataFile="http://weblogs.asp.net/dwahlin/rss.aspx" XPath="rss/channel/item" CacheDuration="60" runat="server" /> </div> The user control can then be placed in the page hosting the Silverlight control as shown below. This example adds a Close button, additional content to display in the overlay window and the HTML generated from the user control. <div id="RSSDiv"> <div style="background-color:#484848;border:1px solid black;height:35px;width:100%;"> <img alt="Close Button" align="right" src="Images/Close.png" onclick="HideOverlay();" style="cursor:pointer;" /> </div> <div style="overflow:auto;width:800px;height:565px;"> <div style="float:left;width:100px;height:103px;margin-left:10px;margin-top:5px;"> <img src="http://weblogs.asp.net/blogs/dwahlin/dan2008.jpg" style="border:1px solid Gray" /> </div> <div style="float:left;width:300px;height:103px;margin-top:5px;"> <a href="http://weblogs.asp.net/dwahlin" style="margin-left:10px;font-size:20pt;">Dan Wahlin's Blog</a> </div> <br /><br /><br /> <div style="clear:both;margin-top:20px;"> <uc:BlogRoller ID="BlogRoller" runat="server" /> </div> </div> </div> Of course, we wouldn’t want the RSS HTML content to be shown until requested. Once it’s requested the absolute position of where it should show above the Silverlight control can be set using standard CSS styles. The following ID selector named #RSSDiv handles hiding the overlay div shown above and determines where it will be display on the screen. #RSSDiv { background-color:White; position:absolute; top:100px; left:300px; width:800px; height:600px; border:1px solid black; display:none; } Now that the HTML content to display above the Silverlight control is set, how can we show it as a user clicks a HyperlinkButton or other control in the application? Fortunately, Silverlight provides an excellent HTML bridge that allows direct access to content hosted within a page. The following code shows two JavaScript functions that can be called from Siverlight to handle showing or hiding HTML overlay content. The two functions rely on jQuery (http://www.jQuery.com) to make it easy to select HTML objects and manipulate their properties: function ShowOverlay() { rssDiv.css('display', 'block'); } function HideOverlay() { rssDiv.css('display', 'none'); } Calling the ShowOverlay function is as simple as adding the following code into the Silverlight application within a button’s Click event handler: private void OverlayHyperlinkButton_Click(object sender, RoutedEventArgs e) { HtmlPage.Window.Invoke("ShowOverlay"); } The result of setting the Silverlight control’s windowless parameter to true and showing the HTML overlay content is shown in the following screenshot:   Thinking Outside the Box to Show HTML Content Setting the windowless parameter to true may not be a viable option for some Silverlight applications or you may simply want to go about showing HTML content a different way. The next technique I’ll show takes advantage of simple HTML, CSS and JavaScript code to handle showing HTML content while a Silverlight application is running in the browser. Keep in mind that with Silverlight’s HTML bridge feature you can always pop-up HTML content in a new browser window using code similar to the following: System.Windows.Browser.HtmlPage.Window.Navigate( new Uri("http://silverlight.net"), "_blank"); For this example I’ll demonstrate how to hide the Silverlight application while maximizing a container div containing the HTML content to show. This allows HTML content to take up the full screen area of the browser without having to set windowless to true and when done right can make the user feel like they never left the Silverlight application. The following HTML shows several div elements that are used to display HTML within the same browser window as the Silverlight application: <div id="JobPlanDiv"> <div style="vertical-align:middle"> <img alt="Close Button" align="right" src="Images/Close.png" onclick="HideJobPlanIFrame();" style="cursor:pointer;" /> </div> <div id="JobPlan_IFrame_Container" style="height:95%;width:100%;margin-top:37px;"></div> </div> The JobPlanDiv element acts as a container for two other divs that handle showing a close button and hosting an iframe that will be added dynamically at runtime. JobPlanDiv isn’t visible when the Silverlight application loads due to the following ID selector added into the page: #JobPlanDiv { position:absolute; background-color:#484848; overflow:hidden; left:0; top:0; height:100%; width:100%; display:none; } When the HTML content needs to be shown or hidden the JavaScript functions shown next can be used: var jobPlanIFrameID = 'JobPlan_IFrame'; var slHost = null; var jobPlanContainer = null; var jobPlanIFrameContainer = null; var rssDiv = null; $(document).ready(function () { slHost = $('#silverlightControlHost'); jobPlanContainer = $('#JobPlanDiv'); jobPlanIFrameContainer = $('#JobPlan_IFrame_Container'); rssDiv = $('#RSSDiv'); }); function ShowJobPlanIFrame(url) { jobPlanContainer.css('display', 'block'); $('<iframe id="' + jobPlanIFrameID + '" src="' + url + '" style="height:100%;width:100%;" />') .appendTo(jobPlanIFrameContainer); slHost.css('width', '0%'); } function HideJobPlanIFrame() { jobPlanContainer.css('display', 'none'); $('#' + jobPlanIFrameID).remove(); slHost.css('width', '100%'); } ShowJobPlanIFrame() handles showing the JobPlanDiv div and adding an iframe into it dynamically. Once JobPlanDiv is shown, the Silverlight control host has its width set to a value of 0% to allow the control to stay alive while making it invisible to the user. I found that this technique works better across multiple browsers as opposed to manipulating the Silverlight control host div’s display or visibility properties. Now that you’ve seen the code to handle showing and hiding the HTML content area, let’s switch focus to the Silverlight application. As a user clicks on a link such as “View Report” the ShowJobPlanIFrame() JavaScript function needs to be called. The following code handles that task: private void ReportHyperlinkButton_Click(object sender, RoutedEventArgs e) { ShowBrowser(_BaseUrl + "/Report.aspx"); } public void ShowBrowser(string url) { HtmlPage.Window.Invoke("ShowJobPlanIFrame", url); } Any URL can be passed into the ShowBrowser() method which handles invoking the JavaScript function. This includes standard web pages or even PDF files. We’ve used this technique frequently with our SmartPrint control (http://www.smartwebcontrols.com) which converts Silverlight screens into PDF documents and displays them. Here’s an example of the content generated:   Silverlight 4’s WebBrowser Control Both techniques shown to this point work well when Silverlight is running in-browser but not so well when it’s running out-of-browser since there’s no host page that you can access using the HTML bridge. Fortunately, Silverlight 4 provides a WebBrowser control that can be used to perform the same functionality quite easily. We’re currently using it in client applications to display PDF documents, SSRS reports and standard HTML content. Using the WebBrowser control simplifies the application quite a bit since no JavaScript is required if the application only runs out-of-browser. Here’s a simple example of defining the WebBrowser control in XAML. I typically define it in MainPage.xaml when a Silverlight Navigation template is used to create the project so that I can re-use the functionality across multiple screens. <Grid x:Name="WebBrowserGrid" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Visibility="Collapsed"> <StackPanel HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> <Border Background="#484848" HorizontalAlignment="Stretch" Height="40"> <Image x:Name="WebBrowserImage" Width="100" Height="33" Cursor="Hand" HorizontalAlignment="Right" Source="/HTMLAndSilverlight;component/Assets/Images/Close.png" MouseLeftButtonDown="WebBrowserImage_MouseLeftButtonDown" /> </Border> <WebBrowser x:Name="JobPlanReportWebBrowser" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" /> </StackPanel> </Grid> Looking through the XAML you can see that a close image is defined along with the WebBrowser control. Because the URL that the WebBrowser should navigate to isn’t known at design time no value is assigned to the control’s Source property. If the XAML shown above is left “as is” you’ll find that any HTML content assigned to the WebBrowser doesn’t display properly. This is due to no height or width being set on the control. To handle this issue the following code is added into the XAML’s code-behind file to dynamically determine the height and width of the page and assign it to the WebBrowser. This is done by handling the SizeChanged event. void MainPage_SizeChanged(object sender, SizeChangedEventArgs e) { WebBrowserGrid.Height = JobPlanReportWebBrowser.Height = ActualHeight; WebBrowserGrid.Width = JobPlanReportWebBrowser.Width = ActualWidth; } When the user wants to view HTML content they click a button which executes the code shown in next: public void ShowBrowser(string url) { if (Application.Current.IsRunningOutOfBrowser) { JobPlanReportWebBrowser.NavigateToString("<html><body><iframe src='" + url + "' style='width:100%;height:97%;' /></body></html>"); WebBrowserGrid.Visibility = Visibility.Visible; } else { HtmlPage.Window.Invoke("ShowJobPlanIFrame", url); } } private void WebBrowserImage_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { WebBrowserGrid.Visibility = Visibility.Collapsed; }   Looking through the code you’ll see that it checks to see if the Silverlight application is running out-of-browser and then either displays the WebBrowser control or runs the JavaScript function discussed earlier. Although the WebBrowser control’s Source property could be assigned the URI of the page to navigate to, by assigning HTML content using the NavigateToString() method and adding an iframe, content can be shown from any site including cross-domain sites. This is especially handy when you need to grab a page from a reporting site that’s in a different domain than the Silverlight application. Here’s an example of viewing  PDF file inside of an out-of-browser application. The first image shows the application running out-of-browser before the user clicks a PDF HyperlinkButton.  The second image shows the PDF being displayed.   While there are certainly other techniques that can be used, the ones shown here have worked well for us in different applications and provide the ability to display HTML content in-browser or out-of-browser. Feel free to add a comment if you have another tip or trick you like to use when working with HTML content in Silverlight applications.   Download Code Sample   For more information about onsite, online and video training, mentoring and consulting solutions for .NET, SharePoint or Silverlight please visit http://www.thewahlingroup.com.

    Read the article

< Previous Page | 100 101 102 103 104 105 106 107 108 109 110 111  | Next Page >