Search Results

Search found 5650 results on 226 pages for 'ref counted pointer'.

Page 1/226 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • To ref or not to ref

    - by nmarun
    So the question is what is the point of passing a reference type along with the ref keyword? I have an Employee class as below: 1: public class Employee 2: { 3: public string FirstName { get; set; } 4: public string LastName { get; set; } 5:  6: public override string ToString() 7: { 8: return string.Format("{0}-{1}", FirstName, LastName); 9: } 10: } In my calling class, I say: 1: class Program 2: { 3: static void Main() 4: { 5: Employee employee = new Employee 6: { 7: FirstName = "John", 8: LastName = "Doe" 9: }; 10: Console.WriteLine(employee); 11: CallSomeMethod(employee); 12: Console.WriteLine(employee); 13: } 14:  15: private static void CallSomeMethod(Employee employee) 16: { 17: employee.FirstName = "Smith"; 18: employee.LastName = "Doe"; 19: } 20: }   After having a look at the code, you’ll probably say, Well, an instance of a class gets passed as a reference, so any changes to the instance inside the CallSomeMethod, actually modifies the original object. Hence the output will be ‘John-Doe’ on the first call and ‘Smith-Doe’ on the second. And you’re right: So the question is what’s the use of passing this Employee parameter as a ref? 1: class Program 2: { 3: static void Main() 4: { 5: Employee employee = new Employee 6: { 7: FirstName = "John", 8: LastName = "Doe" 9: }; 10: Console.WriteLine(employee); 11: CallSomeMethod(ref employee); 12: Console.WriteLine(employee); 13: } 14:  15: private static void CallSomeMethod(ref Employee employee) 16: { 17: employee.FirstName = "Smith"; 18: employee.LastName = "Doe"; 19: } 20: } The output is still the same: Ok, so is there really a need to pass a reference type using the ref keyword? I’ll remove the ‘ref’ keyword and make one more change to the CallSomeMethod method. 1: class Program 2: { 3: static void Main() 4: { 5: Employee employee = new Employee 6: { 7: FirstName = "John", 8: LastName = "Doe" 9: }; 10: Console.WriteLine(employee); 11: CallSomeMethod(employee); 12: Console.WriteLine(employee); 13: } 14:  15: private static void CallSomeMethod(Employee employee) 16: { 17: employee = new Employee 18: { 19: FirstName = "Smith", 20: LastName = "John" 21: }; 22: } 23: } In line 17 you’ll see I’ve ‘new’d up the incoming Employee parameter and then set its properties to new values. The output tells me that the original instance of the Employee class does not change. Huh? But an instance of a class gets passed by reference, so why did the values not change on the original instance or how do I keep the two instances in-sync all the times? Aah, now here’s the answer. In order to keep the objects in sync, you pass them using the ‘ref’ keyword. 1: class Program 2: { 3: static void Main() 4: { 5: Employee employee = new Employee 6: { 7: FirstName = "John", 8: LastName = "Doe" 9: }; 10: Console.WriteLine(employee); 11: CallSomeMethod(ref employee); 12: Console.WriteLine(employee); 13: } 14:  15: private static void CallSomeMethod(ref Employee employee) 16: { 17: employee = new Employee 18: { 19: FirstName = "Smith", 20: LastName = "John" 21: }; 22: } 23: } Viola! Now, to prove it beyond doubt, I said, let me try with another reference type: string. 1: class Program 2: { 3: static void Main() 4: { 5: string name = "abc"; 6: Console.WriteLine(name); 7: CallSomeMethod(ref name); 8: Console.WriteLine(name); 9: } 10:  11: private static void CallSomeMethod(ref string name) 12: { 13: name = "def"; 14: } 15: } The output was as expected, first ‘abc’ and then ‘def’ - proves the 'ref' keyword works here as well. Now, what if I remove the ‘ref’ keyword? The output should still be the same as the above right, since string is a reference type? 1: class Program 2: { 3: static void Main() 4: { 5: string name = "abc"; 6: Console.WriteLine(name); 7: CallSomeMethod(name); 8: Console.WriteLine(name); 9: } 10:  11: private static void CallSomeMethod(string name) 12: { 13: name = "def"; 14: } 15: } Wrong, the output shows ‘abc’ printed twice. Wait a minute… now how could this be? This is because string is an immutable type. This means that any time you modify an instance of string, new memory address is allocated to the instance. The effect is similar to ‘new’ing up the Employee instance inside the CallSomeMethod in the absence of the ‘ref’ keyword. Verdict: ref key came to the rescue and saved the planet… again!

    Read the article

  • kernel module compiling error

    - by wati
    sh@ubuntu:/home/ccpp/helloworld$ make gcc-4.6 -O2 -DMODULE -D_KERNEL_ -W -Wall -Wstrict-prototypes -Wmissing-prototypes -isystem /lib/modules/`uname -r`/build/include -c -o hello-1.o hello-1.c hello-1.c:4:0: warning: "MODULE" redefined [enabled by default] <command-line>:0:0: note: this is the location of the previous definition hello-1.c:6:0: warning: "_KERNEL_" redefined [enabled by default] <command-line>:0:0: note: this is the location of the previous definition In file included from /lib/modules/3.2.0-25-generic/build/include/linux/list.h:4:0, from /lib/modules/3.2.0-25-generic/build/include/linux/module.h:9, from hello-1.c:7: /lib/modules/3.2.0-25-generic/build/include/linux/types.h:13:2: warning: #warning "Attempt to use kernel headers from user space, see http://kernelnewbies.org/KernelHeaders" [-Wcpp] In file included from /lib/modules/3.2.0-25-generic/build/include/linux/module.h:9:0, from hello-1.c:7: /lib/modules/3.2.0-25-generic/build/include/linux/list.h: In function ‘INIT_LIST_HEAD’: /lib/modules/3.2.0-25-generic/build/include/linux/list.h:26:6: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:27:6: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h: In function ‘__list_add’: /lib/modules/3.2.0-25-generic/build/include/linux/list.h:41:6: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:42:5: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:43:5: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:44:6: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h: In function ‘list_add’: /lib/modules/3.2.0-25-generic/build/include/linux/list.h:62:28: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h: In function ‘list_add_tail’: /lib/modules/3.2.0-25-generic/build/include/linux/list.h:76:22: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h: In function ‘__list_del’: /lib/modules/3.2.0-25-generic/build/include/linux/list.h:88:6: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:89:6: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h: In function ‘__list_del_entry’: /lib/modules/3.2.0-25-generic/build/include/linux/list.h:101:18: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:101:31: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h: In function ‘list_del’: /lib/modules/3.2.0-25-generic/build/include/linux/list.h:106:18: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:106:31: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:107:7: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:108:7: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h: In function ‘list_replace’: /lib/modules/3.2.0-25-generic/build/include/linux/list.h:125:5: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:125:17: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:126:5: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:127:5: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:127:17: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:128:5: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h: In function ‘list_is_last’: /lib/modules/3.2.0-25-generic/build/include/linux/list.h:179:13: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h: In function ‘list_empty’: /lib/modules/3.2.0-25-generic/build/include/linux/list.h:188:13: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h: In function ‘list_empty_careful’: /lib/modules/3.2.0-25-generic/build/include/linux/list.h:206:31: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:207:40: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h: In function ‘list_rotate_left’: /lib/modules/3.2.0-25-generic/build/include/linux/list.h:219:15: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h: In function ‘list_is_singular’: /lib/modules/3.2.0-25-generic/build/include/linux/list.h:230:35: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:230:49: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h: In function ‘__list_cut_position’: /lib/modules/3.2.0-25-generic/build/include/linux/list.h:236:37: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:237:6: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:237:19: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:238:6: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:239:6: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:240:7: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:241:6: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:242:11: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h: In function ‘list_cut_position’: /lib/modules/3.2.0-25-generic/build/include/linux/list.h:265:8: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h: In function ‘__list_splice’: /lib/modules/3.2.0-25-generic/build/include/linux/list.h:277:32: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:278:31: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:280:7: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:281:6: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:283:6: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:284:6: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h: In function ‘list_splice’: /lib/modules/3.2.0-25-generic/build/include/linux/list.h:296:33: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h: In function ‘list_splice_tail’: /lib/modules/3.2.0-25-generic/build/include/linux/list.h:308:27: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h: In function ‘list_splice_init’: /lib/modules/3.2.0-25-generic/build/include/linux/list.h:322:33: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h: In function ‘list_splice_tail_init’: /lib/modules/3.2.0-25-generic/build/include/linux/list.h:339:27: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h: In function ‘INIT_HLIST_NODE’: /lib/modules/3.2.0-25-generic/build/include/linux/list.h:572:3: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:573:3: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h: In function ‘hlist_unhashed’: /lib/modules/3.2.0-25-generic/build/include/linux/list.h:578:11: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h: In function ‘hlist_empty’: /lib/modules/3.2.0-25-generic/build/include/linux/list.h:583:11: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h: In function ‘__hlist_del’: /lib/modules/3.2.0-25-generic/build/include/linux/list.h:588:29: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:589:31: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:592:7: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h: In function ‘hlist_del’: /lib/modules/3.2.0-25-generic/build/include/linux/list.h:598:3: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:599:3: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h: In function ‘hlist_add_head’: /lib/modules/3.2.0-25-generic/build/include/linux/list.h:612:30: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:613:3: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:615:8: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:615:20: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:616:3: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:617:3: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:617:15: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h: In function ‘hlist_add_before’: /lib/modules/3.2.0-25-generic/build/include/linux/list.h:624:3: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:624:17: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:625:3: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:626:6: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:626:18: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:627:5: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h: In function ‘hlist_add_after’: /lib/modules/3.2.0-25-generic/build/include/linux/list.h:633:6: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:633:16: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:634:3: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:635:6: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:635:18: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:637:9: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:638:7: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:638:29: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h: In function ‘hlist_add_fake’: /lib/modules/3.2.0-25-generic/build/include/linux/list.h:644:3: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:644:15: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h: In function ‘hlist_move_list’: /lib/modules/3.2.0-25-generic/build/include/linux/list.h:654:5: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:654:18: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:655:9: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:656:6: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:656:27: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:657:5: error: dereferencing pointer to incomplete type In file included from /lib/modules/3.2.0-25-generic/build/include/linux/module.h:12:0, from hello-1.c:7: /lib/modules/3.2.0-25-generic/build/include/linux/cache.h: At top level: /lib/modules/3.2.0-25-generic/build/include/linux/cache.h:5:23: fatal error: asm/cache.h: No such file or directory compilation terminated. make: *** [hello-1.o] Error 1 i got this error after compiling an helloworld program my program is #define MODULE #define LINUX #define _KERNEL_ #include <linux/module.h> #include <linux/kernel.h> int init_module(void) { printk("<1>hello World 1.\n"); return 0; } void cleanup_module(void) { printk(KERN_ALERT "goodbye world 1.\n"); } MODULE_LICENSE("GPL"); my make file is: TARGET := hello-1 WARN := -W -Wall -Wstrict-prototypes -Wmissing-prototypes INCLUDE := -isystem /lib/modules/`uname -r`/build/include CFLAGS := -O2 -DMODULE -D_KERNEL_ ${WARN} ${INCLUDE} CC := gcc-4.6 ${TARGET}.o: ${TARGET}.c .PHONY: clean clean: rm -rf ${TARGET}.o iam usin kernel 3.2.0.25 as novice i can't able to figure out where the problem is I SEARCHED EVERY THING I CAN TO KNOW ABOUT THIS ERROR BUT I CANT UNDERSTAND &I GET IRRELEVANT DOCS anybody help me please

    Read the article

  • Using a ref Parameter with the this Keyword?

    - by grefly
    Is there a way to force the this keyword to act as a ref argument? I would like to pass in a visitor that modifies multiple properties on the object, but this only wants to act like a value parameter. Code in Object: public void Accept(Visitor<MyObject> visitor) { visitor.Visit(this); } Code in Visitor: public void Visit(ref Visitor<MyObject> receiver) { receiver.Property = new PropertyValue(); receiver.Property2 = new PropertyValue(); }

    Read the article

  • Need suggestions on how to extract data from .docx/.doc file then into mssql

    - by DarkPP
    I'm suppose to develop an automated application for my project, it will load past-year examination/exercises paper (word file), detect the sections accordingly, extract the questions and images in that section, and then store the questions and images into the database. (Preview of the question paper is at the bottom of this post) So I need some suggestions on how to extract data from a word file, then inserting them into a database. Currently I have a few methods to do so, however I have no idea how I could implement them when the file contains textboxes with background image. The question has to link with the image. Method One (Make use of ms office interop) Load the word file - Extract image, save into a folder - Extract text, save as .txt - Extract text from .txt then store in db Question: How i detect the section and question. How I link the image to the question. Extract text from word file (Working): private object missing = Type.Missing; private object sFilename = @"C:\temp\questionpaper.docx"; private object sFilename2 = @"C:\temp\temp.txt"; private object readOnly = true; object fileFormat = Word.WdSaveFormat.wdFormatText; private void button1_Click(object sender, EventArgs e) { Word.Application wWordApp = new Word.Application(); wWordApp.DisplayAlerts = Word.WdAlertLevel.wdAlertsNone; Word.Document dFile = wWordApp.Documents.Open(ref sFilename, ref missing, ref readOnly, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing); dFile.SaveAs(ref sFilename2, ref fileFormat, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing,ref missing, ref missing,ref missing,ref missing,ref missing,ref missing, ref missing,ref missing); dFile.Close(ref missing, ref missing, ref missing); } Extract image from word file (Doesn't work on image inside textbox): private Word.Application wWordApp; private int m_i; private object missing = Type.Missing; private object filename = @"C:\temp\questionpaper.docx"; private object readOnly = true; private void CopyFromClipbordInlineShape(String imageIndex) { Word.InlineShape inlineShape = wWordApp.ActiveDocument.InlineShapes[m_i]; inlineShape.Select(); wWordApp.Selection.Copy(); Computer computer = new Computer(); if (computer.Clipboard.GetDataObject() != null) { System.Windows.Forms.IDataObject data = computer.Clipboard.GetDataObject(); if (data.GetDataPresent(System.Windows.Forms.DataFormats.Bitmap)) { Image image = (Image)data.GetData(System.Windows.Forms.DataFormats.Bitmap, true); image.Save("C:\\temp\\DoCremoveImage" + imageIndex + ".png", System.Drawing.Imaging.ImageFormat.Png); } } } private void button1_Click(object sender, EventArgs e) { wWordApp = new Word.Application(); wWordApp.Documents.Open(ref filename, ref missing, ref readOnly, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing); try { for (int i = 1; i <= wWordApp.ActiveDocument.InlineShapes.Count; i++) { m_i = i; CopyFromClipbordInlineShape(Convert.ToString(i)); } } finally { object save = false; wWordApp.Quit(ref save, ref missing, ref missing); wWordApp = null; } } Method Two Unzip the word file (.docx) - Copy the media(image) folder, store somewhere - Parse the XML file - Store the text in db Any suggestion/help would be greatly appreciated :D Preview of the word file: (backup link: http://i.stack.imgur.com/YF1Ap.png)

    Read the article

  • Pinvoke- to call a function with pointer to pointer to pointer parameter

    - by jambodev
    complete newbe in PInvoke. I have a function in C with this signature: int addPos(int init_array_size, int *cnt, int *array_size, PosT ***posArray, PosT ***hPtr, char *id, char *record_id, int num, char *code, char *type, char *name, char *method, char *cont1, char *cont2, char *cont_type, char *date1, char *date_day, char *date2, char *dsp, char *curr, char *contra_acc, char *np, char *ten, char *dsp2, char *covered, char *cont_subtype, char *Xcode, double strike, int version, double t_price, double long, double short, double scale, double exrcised_price, char *infoMsg); and here is how PosT looks like: typedef union pu { struct dpos d; struct epo e; struct bpos b; struct spos c; } PosT ; my questions are: 1- do I need to define a class in CSharp representing PosT? 2- how do I pass PosT ***posArray parameter across frm CSharp to C? 3- How do I specify marshaling for it all? I Do appreciate your help

    Read the article

  • convert pointer to pointer to void pointer

    - by FihopZz
    When I'm learning to use qsort to sort an array of string, there is a question puzzled me. For example, to sort the following s char *s[] = { "Amit", "Garima", "Gaurav", "Vaibhav" }; To use the qsort, you must provide a comparison function like the following function cstring_cmp I guess in the qsort function, the type of parameter to be passed to the function cstring_cmp is char**. How to convert a char** to a void*? Why can we convert a char** to a void*? int cstring_cmp(const void *a, const void *b) { const char **ia = (const char **)a; const char **ib = (const char **)b; return -strcasecmp(*ia, *ib); /* return the negative of the normal comparison */ }

    Read the article

  • resource-ref at application scope in EJB 2.1 Project

    - by Mike Deck
    Is it possible to define resource references that are applicable to all EJBs in an application? Currently I have an ejb-jar.xml that looks something like this: <ejb-jar> <enterprise-beans> <session id="foo"> <!-- snip --> <resource-ref> <res-ref-name>jdbc/myDatasource</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> </resource-ref> </session> <session id="bar"> <!-- snip --> <resource-ref> <res-ref-name>jdbc/myDatasource</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> </resource-ref> </session> </enterprise-beans> </ejb-jar> You'll notice that both EJBs have the same resource-ref defined for both of them. Is there a way to factor this duplication out within a J2EE 1.4 application? Ideally I should be able to define the jdbc/myDatasource resource once within the application and have anything running inside that container be able to access it by doing a JNDI lookup for "java:comp/env/jdbc/myDatasource". Is there any way to accomplish this?

    Read the article

  • Passing Strings by Ref

    - by SGWellens
    Humbled yet again…DOH! No matter how much experience you acquire, no matter how smart you may be, no matter how hard you study, it is impossible to keep fully up to date on all the nuances of the technology we are exposed to. There will always be gaps in our knowledge: Little 'dead zones' of uncertainty. For me, this time, it was about passing string parameters to functions. I thought I knew this stuff cold. First, a little review... Value Types and Ref Integers and structs are value types (as opposed to reference types). When declared locally, their memory storage is on the stack; not on the heap. When passed to a function, the function gets a copy of the data and works on the copy. If a function needs to change a value type, you need to use the ref keyword.  Here's an example:     // ---- declaration -----------------     public struct MyStruct    {        public string StrTag;    }     // ---- functions -----------------------     void SetMyStruct(MyStruct myStruct)     // pass by value    {        myStruct.StrTag = "BBB";    }     void SetMyStruct(ref MyStruct myStruct)  // pass by ref    {        myStruct.StrTag = "CCC";    }     // ---- Usage -----------------------     protected void Button1_Click(object sender, EventArgs e)    {        MyStruct Data;        Data.StrTag = "AAA";         SetMyStruct(Data);        // Data.StrTag is still "AAA"         SetMyStruct(ref Data);        // Data.StrTag is now "CCC"    } No surprises here. All value types like ints, floats, datetimes, enums, structs, etc. work the same way. And now on to... Class Types and Ref     // ---- Declaration -----------------------------     public class MyClass    {        public string StrTag;    }     // ---- Functions ----------------------------     void SetMyClass(MyClass myClass)  // pass by 'value'    {        myClass.StrTag = "BBB";    }     void SetMyClass(ref MyClass myClass)   // pass by ref    {        myClass.StrTag = "CCC";    }     // ---- Usage ---------------------------------------     protected void Button2_Click(object sender, EventArgs e)    {        MyClass Data = new MyClass();        Data.StrTag = "AAA";         SetMyClass(Data);          // Data.StrTag is now "BBB"         SetMyClass(ref Data);        // Data.StrTag is now "CCC"    }  No surprises here either. Since Classes are reference types, you do not need the ref keyword to modify an object. What may seem a little strange is that with or without the ref keyword, the results are the same: The compiler knows what to do. So, why would you need to use the ref keyword when passing an object to a function? Because then you can change the reference itself…ie you can make it refer to a completely different object. Inside the function you can do: myClass = new MyClass() and the old object will be garbage collected and the new object will be returned to the caller. That ends the review. Now let's look at passing strings as parameters. The String Type and Ref Strings are reference types. So when you pass a String to a function, you do not need the ref keyword to change the string. Right? Wrong. Wrong, wrong, wrong. When I saw this, I was so surprised that I fell out of my chair. Getting up, I bumped my head on my desk (which really hurt). My bumping the desk caused a large speaker to fall off of a bookshelf and land squarely on my big toe. I was screaming in pain and hopping on one foot when I lost my balance and fell. I struck my head on the side of the desk (once again) and knocked myself out cold. When I woke up, I was in the hospital where due to a database error (thanks Oracle) the doctors had put casts on both my hands. I'm typing this ever so slowly with just my ton..tong ..tongu…tongue. But I digress. Okay, the only true part of that story is that I was a bit surprised. Here is what happens passing a String to a function.     // ---- Functions ----------------------------     void SetMyString(String myString)   // pass by 'value'    {        myString = "BBB";    }     void SetMyString(ref String myString)  // pass by ref    {        myString = "CCC";    }     // ---- Usage ---------------------------------     protected void Button3_Click(object sender, EventArgs e)    {        String MyString = "AAA";         SetMyString(MyString);        // MyString is still "AAA"  What!!!!         SetMyString(ref MyString);        // MyString is now "CCC"    } What the heck. We should not have to use the ref keyword when passing a String because Strings are reference types. Why didn't the string change? What is going on?   I spent hours unssuccessfully researching this anomaly until finally, I had a Eureka moment: This code: String MyString = "AAA"; Is semantically equivalent to this code (note this code doesn't actually compile): String MyString = new String(); MyString = "AAA"; Key Point: In the function, the copy of the reference is pointed to a new object and THAT object is modified. The original reference and what it points to is unchanged. You can simulate this behavior by modifying the class example code to look like this:      void SetMyClass(MyClass myClass)  // call by 'value'    {        //myClass.StrTag = "BBB";        myClass = new MyClass();        myClass.StrTag = "BBB";    } Now when you call the SetMyClass function without using ref, the parameter is unchanged...just like the string example.  I hope someone finds this useful. Steve Wellens

    Read the article

  • SWIG: C++ to C#, pointer to pointer marshalling.

    - by CaRT
    I have some legacy code I want to port to C#. I cannot modify the C++ code, I just have to make do with what I'm given. So, the situation. I'm using SwIG, and I came across this function: void MarshalMe(int iNum, FooClass** ioFooClassArray); If I ran SWIG over this, it wouldn't know what to do with the array, so it will create a SWIGTYPE_p_pFooClass. Fair enough! C# code for this would look like void MarshalMe(int iNum, SWIGTYPE_p_p_FooClass ioFooClassArray); // Not ideal! There are some techniques for marshalling this kind of code correctly, so I tried a few of them: %typemap(ctype) FooClass** "FooClass**" %typemap(cstype) FooClass** "FooClass[]" %typemap(imtype, inattributes="[In, Out, MarshalAs(UnmanagedType.LPArray)]") FooClass** "FooClass[]" %typemap(csin) FooClass** "$csinput" %typemap(in) FooClass** "$1 = $input;" %typemap(freearg) FooClass** "" %typemap(argout) FooClass** "" This effectively creates a nicer signature: void MarshalMe(int iNum, FooClass[] ioFooClassArray); // Looks good! Would it work? However, when I try to run it, I get the following error: {"Exception of type 'System.ExecutionEngineException' was thrown."} Any ideas about the actual typemap?

    Read the article

  • invasive vs non-invasive ref-counted pointers in C++

    - by anon
    For the past few years, I've generally accepted that if I am going to use ref-counted smart pointers invasive smart pointers is the way to go -- However, I'm starting to like non-invasive smart pointers due to the following: I only use smart pointers (so no Foo* lying around, only Ptr) I'm starting to build custom allocators for each class. (So Foo would overload operator new). Now, if Foo has a list of all Ptr (as it easily can with non-invasive smart pointers). Then, I can avoid memory fragmentation issues since class Foo move the objects around (and just update the corresponding Ptr). The only reason why this Foo moving objects around in non-invasive smart pointers being easier than invasive smart pointers is: In non-invasive smart pointers, there is only one pointer that points to each Foo. In invasive smart pointers, I have no idea how many objects point to each Foo. Now, the only cost of non-invasive smart pointers ... is the double indirection. [Perhaps this screws up the caches]. Does anyone have a good study of expensive this extra layer of indirection is?

    Read the article

  • Fill in word form field with more than 255 characters

    - by user1308743
    I am trying to programmaticly fill in a microsoft word form. I am successfully able to do so if the string is under 255 chars with the following code below, however it says the string is too long if i try and use a string over 255 chars... How do I get past this limitation? If I open the word doc in word I can type in more than 255 chars without a problem. Does anyone know how to input more characters via c# code? object fileName = strFileName; object readOnly = false; object isVisible = true; object missing = System.Reflection.Missing.Value; //open doc _oDoc = _oWordApplic.Documents.Open(ref fileName, ref missing, ref readOnly, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref isVisible, ref missing, ref missing, ref missing, ref missing); _oDoc.Activate(); //write string _oDoc.FormFields[oBookMark].Result = value; //save and close oDoc.SaveAs(ref fileName, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing); _oWordApplic.Application.Quit(ref missing, ref missing, ref missing);

    Read the article

  • Passing control references as ref parameters

    - by Enmanuel
    Hi everyone. Please help me out here because im getting kind of confused.. I have a form in a C# winforms project and a couple of methods that are suposed to perform some tasks for this particular form and all derived ones, so one of those helper methods can make the example.. this one should fill comboboxes with a dataset. Its working properly now but when i coded the method with this signature protected void FillComboBox(kComboBox target, IEntClass_DA entity) { target.DataSource = entity.GetList().Tables[0]; target.DisplayMember = "name"; target.ValueMember = "id"; } I saw that the displayMember and ValueMember in the comboboxes were not holding the values after the method call. I just thought I should use ref parameters so the asignments are not wasted in read-only reference variables. It was ok by then but later, making an exercise of passing the whole form as a parameter I was warned by the compiler with the notice that this could not be passed as a ref parameter because it is read-only. Fine then, I keep working and see that even without the ref keyword i can use the ref variable from the form, update some properties and see the changes. So whats happening here: passing a reference of the control to the helper method gives me ability to change its members even when not using the ref parameter?? Thanks.

    Read the article

  • \ref Chapter Name in LaTeX

    - by joec
    Is it possible to use \ref{chap:conclusion} to refer to the actual name of the chapter instead of the chapter counter in LaTeX? So that I can do this: See the \ref{chap:conclusion} chapter for more information See the Conclusion chapter for more information instead of: See Chapter \ref{chap:conclusion} for more See Chapter 6 for more Thanks

    Read the article

  • Undefined symbols after installing new xcode 3.2.3 build

    - by toofah
    I want to move to the new XCode 3.2.3 GM Seed build for development, but when I bring up my project I get 'base sdk missing' because my project is set to use iPhone SDK 3.0. If I change 'base SDK' to iPhone 3.2 or 4.0 and then compile I get a lot of errors that I don't understand. I dumped a few of them below. Can anyone tell me what I am missing? Also, can someone confirm that if I choose 'base sdk' of iPhone 3.2 or 4.0 that I can still choose 'target device' of iPhone 3.0 and not force my customers to install the new SDK. I really don't want to be the app that forces my customers to upgrade their OS. Thanks! Undefined symbols: ".objc_class_name_NSObject", referenced from: .objc_class_name_FlurryAPI in libFlurry.a(FlurryAPI.o) .objc_class_name_FlurrySession in libFlurry.a(FlurrySession.o) .objc_class_name_FlurryHTTPEater in libFlurry.a(FlurryHTTPEater.o) .objc_class_name_FlurryHTTPResponse in libFlurry.a(FlurryHTTPResponse.o) .objc_class_name_FlurryConnectionDelegate in libFlurry.a(FlurryConnectionDelegate.o) .objc_class_name_FlurryAd in libFlurry.a(FlurryAd.o) .objc_class_name_FlurryAdParser in libFlurry.a(FlurryAdParser.o) literal-pointer@_OBJC@_cls_refs@NSObject in libFlurry.a(FlurryAdView.o) .objc_class_name_FlurryAdImage in libFlurry.a(FlurryAdImage.o) .objc_class_name_FlurryAdImpression in libFlurry.a(FlurryAdImpression.o) .objc_class_name_FlurryPageViewDelegate in libFlurry.a(FlurryPageViewDelegate.o) .objc_class_name_FlurryAdTheme in libFlurry.a(FlurryAdTheme.o) .objc_class_name_FlurryAdHook in libFlurry.a(FlurryAdHook.o) .objc_class_name_FlurryAdProperties in libFlurry.a(FlurryAdProperties.o) .objc_class_name_FlurryFileCache in libFlurry.a(FlurryFileCache.o) .objc_class_name_FlurryEvent in libFlurry.a(FlurryEvent.o) .objc_class_name_FlurryProtocolData in libFlurry.a(FlurryProtocolData.o) .objc_class_name_FlurryAdAssignment in libFlurry.a(FlurryAdAssignment.o) .objc_class_name_FlurryAdAppStoreConnectionDelegate in libFlurry.a(FlurryAdAppStoreConnectionDelegate.o) .objc_class_name_FlurryHeartBeater in libFlurry.a(FlurryHeartBeater.o) .objc_class_name_FlurryImageCache in libFlurry.a(FlurryImageCache.o) .objc_class_name_FlurryUtil in libFlurry.a(FlurryUtil.o) .objc_class_name_FlurryAdNavigationDelegate in libFlurry.a(FlurryAdNavigationDelegate.o) .objc_class_name_FlurryAdLocation in libFlurry.a(FlurryAdLocation.o) .objc_class_name_FlurryAdDimension in libFlurry.a(FlurryAdDimension.o) .objc_class_name_FlurryAdTextStyle in libFlurry.a(FlurryAdTextStyle.o) ".objc_class_name_NSFileManager", referenced from: literal-pointer@_OBJC@_cls_refs@NSFileManager in libFlurry.a(FlurrySession.o) literal-pointer@_OBJC@_cls_refs@NSFileManager in libFlurry.a(FlurryFileCache.o) ".objc_class_name_NSString", referenced from: literal-pointer@_OBJC@_cls_refs@NSString in libFlurry.a(FlurrySession.o) literal-pointer@_OBJC@_cls_refs@NSString in libFlurry.a(FlurryHTTPEater.o) literal-pointer@_OBJC@_cls_refs@NSString in libFlurry.a(FlurryHTTPResponse.o) literal-pointer@_OBJC@_cls_refs@NSString in libFlurry.a(FlurryAd.o) literal-pointer@_OBJC@_cls_refs@NSString in libFlurry.a(FlurryAdParser.o) literal-pointer@_OBJC@_cls_refs@NSString in libFlurry.a(FlurryAdCanvasViewController.o) literal-pointer@_OBJC@_cls_refs@NSString in libFlurry.a(FlurryFileCache.o) literal-pointer@_OBJC@_cls_refs@NSString in libFlurry.a(FlurryImageCache.o) ".objc_class_name_NSError", referenced from: literal-pointer@_OBJC@_cls_refs@NSError in libFlurry.a(FlurryUtil.o) "_OBJC_METACLASS_$_FlurryAPI", referenced from: _OBJC_METACLASS_$_NFlurryAPI in NFlurryAPI.o ".objc_class_name_UIWindow", referenced from: literal-pointer@_OBJC@_cls_refs@UIWindow in libFlurry.a(FlurryAdCanvasViewController.o) ".objc_class_name_NSException", referenced from: literal-pointer@_OBJC@_cls_refs@NSException in libFlurry.a(FlurrySession.o) literal-pointer@_OBJC@_cls_refs@NSException in libFlurry.a(FlurryUtil.o) ".objc_class_name_UIColor", referenced from: literal-pointer@_OBJC@_cls_refs@UIColor in libFlurry.a(FlurryAdParser.o) literal-pointer@_OBJC@_cls_refs@UIColor in libFlurry.a(FlurryAdView.o) literal-pointer@_OBJC@_cls_refs@UIColor in libFlurry.a(FlurryAdCanvasViewController.o) literal-pointer@_OBJC@_cls_refs@UIColor in libFlurry.a(FlurryAdCanvasView.o) "_OBJC_CLASS_$_FlurryAPI", referenced from: _OBJC_CLASS_$_NFlurryAPI in NFlurryAPI.o ".objc_class_name_NSMutableSet", referenced from: literal-pointer@_OBJC@_cls_refs@NSMutableSet in libFlurry.a(FlurryAdAssignment.o) ".objc_class_name_UIFont", referenced from: literal-pointer@_OBJC@_cls_refs@UIFont in libFlurry.a(FlurryAdView.o) literal-pointer@_OBJC@_cls_refs@UIFont in libFlurry.a(FlurryAdCanvasView.o) ".objc_class_name_UIImage", referenced from: literal-pointer@_OBJC@_cls_refs@UIImage in libFlurry.a(FlurryAdParser.o) literal-pointer@_OBJC@_cls_refs@UIImage in libFlurry.a(FlurryAdImage.o) ".objc_class_name_UIApplication", referenced from: literal-pointer@_OBJC@_cls_refs@UIApplication in libFlurry.a(FlurryAdView.o) literal-pointer@_OBJC@_cls_refs@UIApplication in libFlurry.a(FlurryAdCanvasViewController.o) literal-pointer@_OBJC@_cls_refs@UIApplication in libFlurry.a(FlurryAdAppStoreConnectionDelegate.o) ".objc_class_name_UILabel", referenced from: literal-pointer@_OBJC@_cls_refs@UILabel in libFlurry.a(FlurryAdView.o) literal-pointer@_OBJC@_cls_refs@UILabel in libFlurry.a(FlurryAdCanvasViewController.o) literal-pointer@_OBJC@_cls_refs@UILabel in libFlurry.a(FlurryAdCanvasView.o) ".objc_class_name_UIView", referenced from: literal-pointer@_OBJC@_cls_refs@UIView in libFlurry.a(FlurryAdView.o) .objc_class_name_FlurryAdView in libFlurry.a(FlurryAdView.o) literal-pointer@_OBJC@_cls_refs@UIView in libFlurry.a(FlurryAdCanvasViewController.o) .objc_class_name_FlurryAdListView in libFlurry.a(FlurryAdListView.o) ".objc_class_name_NSMutableString", referenced from: literal-pointer@_OBJC@_cls_refs@NSMutableString in libFlurry.a(FlurrySession.o) literal-pointer@_OBJC@_cls_refs@NSMutableString in libFlurry.a(FlurryHTTPEater.o) literal-pointer@_OBJC@_cls_refs@NSMutableString in libFlurry.a(FlurryAdView.o) ".objc_class_name_NSTimer", referenced from: literal-pointer@_OBJC@_cls_refs@NSTimer in libFlurry.a(FlurryHeartBeater.o) ".objc_class_name_NSMutableData", referenced from: literal-pointer@_OBJC@_cls_refs@NSMutableData in libFlurry.a(FlurrySession.o) literal-pointer@_OBJC@_cls_refs@NSMutableData in libFlurry.a(FlurryConnectionDelegate.o) literal-pointer@_OBJC@_cls_refs@NSMutableData in libFlurry.a(FlurryAdImpression.o) literal-pointer@_OBJC@_cls_refs@NSMutableData in libFlurry.a(FlurryEvent.o) ".objc_class_name_NSNumber", referenced from: literal-pointer@_OBJC@_cls_refs@NSNumber in libFlurry.a(FlurryAPI.o) literal-pointer@_OBJC@_cls_refs@NSNumber in libFlurry.a(FlurrySession.o) literal-pointer@_OBJC@_cls_refs@NSNumber in libFlurry.a(FlurryAdParser.o) literal-pointer@_OBJC@_cls_refs@NSNumber in libFlurry.a(FlurryAdView.o) literal-pointer@_OBJC@_cls_refs@NSNumber in libFlurry.a(FlurryAdImpression.o) literal-pointer@_OBJC@_cls_refs@NSNumber in libFlurry.a(FlurryAdCanvasViewController.o) "_objc_exception_match", referenced from: +[FlurrySession createActiveFlurrySession:] in libFlurry.a(FlurrySession.o) +[FlurrySession dataForSessions:requestAds:] in libFlurry.a(FlurrySession.o) +[FlurrySession initialTimestamp] in libFlurry.a(FlurrySession.o) ".objc_class_name_UINavigationItem", referenced from: literal-pointer@_OBJC@_cls_refs@UINavigationItem in libFlurry.a(FlurryAdCanvasViewController.o) ".objc_class_name_UIViewController", referenced from: literal-pointer@_OBJC@_cls_refs@UIViewController in libFlurry.a(FlurryAdView.o) .objc_class_name_FlurryAdCanvasViewController in libFlurry.a(FlurryAdCanvasViewController.o) ".objc_class_name_NSMutableArray", referenced from: literal-pointer@_OBJC@_cls_refs@NSMutableArray in libFlurry.a(FlurrySession.o) literal-pointer@_OBJC@_cls_refs@NSMutableArray in libFlurry.a(FlurryHTTPEater.o) literal-pointer@_OBJC@_cls_refs@NSMutableArray in libFlurry.a(FlurryAdParser.o) literal-pointer@_OBJC@_cls_refs@NSMutableArray in libFlurry.a(FlurryImageCache.o) literal-pointer@_OBJC@_cls_refs@NSMutableArray in libFlurry.a(FlurryAdNavigationDelegate.o) ".objc_class_name_UIScreen", referenced from: literal-pointer@_OBJC@_cls_refs@UIScreen in libFlurry.a(FlurryAdCanvasViewController.o) ".objc_class_name_NSURLCache", referenced from: literal-pointer@_OBJC@_cls_refs@NSURLCache in libFlurry.a(FlurryHTTPEater.o) ".objc_class_name_NSNotificationCenter", referenced from: literal-pointer@_OBJC@_cls_refs@NSNotificationCenter in libFlurry.a(FlurryAPI.o) literal-pointer@_OBJC@_cls_refs@NSNotificationCenter in libFlurry.a(FlurryAdParser.o) literal-pointer@_OBJC@_cls_refs@NSNotificationCenter in libFlurry.a(FlurryAdView.o) literal-pointer@_OBJC@_cls_refs@NSNotificationCenter in libFlurry.a(FlurryHeartBeater.o) ".objc_class_name_NSInvocation", referenced from: literal-pointer@_OBJC@_cls_refs@NSInvocation in libFlurry.a(FlurryPageViewDelegate.o) ".objc_class_name_NSURL", referenced from: literal-pointer@_OBJC@_cls_refs@NSURL in libFlurry.a(FlurrySession.o) literal-pointer@_OBJC@_cls_refs@NSURL in libFlurry.a(FlurryHTTPEater.o) literal-pointer@_OBJC@_cls_refs@NSURL in libFlurry.a(FlurryAdView.o) literal-pointer@_OBJC@_cls_refs@NSURL in libFlurry.a(FlurryAdCanvasViewController.o) "_objc_exception_extract", referenced from: +[FlurryAPI startSession:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI startSession:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI endSession] in libFlurry.a(FlurryAPI.o) +[FlurryAPI endSession] in libFlurry.a(FlurryAPI.o) +[FlurryAPI pauseSession] in libFlurry.a(FlurryAPI.o) +[FlurryAPI pauseSession] in libFlurry.a(FlurryAPI.o) +[FlurryAPI resumeSession] in libFlurry.a(FlurryAPI.o) +[FlurryAPI resumeSession] in libFlurry.a(FlurryAPI.o) +[FlurryAPI logEvent:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI logEvent:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI logEvent:withParameters:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI logEvent:withParameters:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI logEvent:timed:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI logEvent:timed:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI logEvent:withParameters:timed:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI logEvent:withParameters:timed:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI endTimedEvent:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI endTimedEvent:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI logError:message:exception:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI logError:message:exception:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI logError:message:error:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI logError:message:error:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI countPageViews:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI countPageViews:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI countPageView] in libFlurry.a(FlurryAPI.o) +[FlurryAPI countPageView] in libFlurry.a(FlurryAPI.o) +[FlurryAPI setUserID:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI setUserID:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI setEventLoggingEnabled:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI setEventLoggingEnabled:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI setServerURL:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI setServerURL:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI setCanvasURL:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI setCanvasURL:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI setLandscapeCanvasURL:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI setLandscapeCanvasURL:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI setAppStoreURL:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI setAppStoreURL:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI setSessionReportsOnCloseEnabled:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI setSessionReportsOnCloseEnabled:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI setAppVersion:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI setAppVersion:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI setGender:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI setGender:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI setAge:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI setAge:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI getHook:xLoc:yLoc:view:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI getHook:xLoc:yLoc:view:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI getHook:xLoc:yLoc:view:attachToView:orientation:canvasOrientation:autoRefresh:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI getHook:xLoc:yLoc:view:attachToView:orientation:canvasOrientation:autoRefresh:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI updateHook:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI updateHook:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI removeHook:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI removeHook:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI openCatalog:canvasOrientation:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI openCatalog:canvasOrientation:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI setAppCircleDelegate:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI setAppCircleDelegate:] in libFlurry.a(FlurryAPI.o) +[FlurrySession createActiveFlurrySession:] in libFlurry.a(FlurrySession.o) +[FlurrySession createActiveFlurrySession:] in libFlurry.a(FlurrySession.o) +[FlurrySession sendSessionsToServerWithTimeout:useWebView:requestAds:] in libFlurry.a(FlurrySession.o) +[FlurrySession sendSessionsToServerWithTimeout:useWebView:requestAds:] in libFlurry.a(FlurrySession.o) +[FlurrySession dataForSessions:requestAds:] in libFlurry.a(FlurrySession.o) +[FlurrySession dataForSessions:requestAds:] in libFlurry.a(FlurrySession.o) +[FlurrySession initialTimestamp] in libFlurry.a(FlurrySession.o) +[FlurrySession initialTimestamp] in libFlurry.a(FlurrySession.o) +[FlurryAdParser oldInstance] in libFlurry.a(FlurryAdParser.o) +[FlurryAdParser instance] in libFlurry.a(FlurryAdParser.o) -[FlurryAdView initWithAd:hook:xLoc:yLoc:parent:attachToView:orientation:canvasOrientation:autoRefresh:] in libFlurry.a(FlurryAdView.o) -[FlurryAdView initWithAd:hook:xLoc:yLoc:parent:attachToView:orientation:canvasOrientation:autoRefresh:] in libFlurry.a(FlurryAdView.o) -[FlurryAdView refreshWithAd] in libFlurry.a(FlurryAdView.o) -[FlurryAdView refreshWithAd] in libFlurry.a(FlurryAdView.o) -[FlurryAdView updateToOrientation] in libFlurry.a(FlurryAdView.o) -[FlurryAdView updateToOrientation] in libFlurry.a(FlurryAdView.o) -[FlurryAdView touchesEnded:withEvent:] in libFlurry.a(FlurryAdView.o) -[FlurryAdView touchesEnded:withEvent:] in libFlurry.a(FlurryAdView.o) -[FlurryAdView alertView:clickedButtonAtIndex:] in libFlurry.a(FlurryAdView.o) -[FlurryAdView alertView:clickedButtonAtIndex:] in libFlurry.a(FlurryAdView.o) -[FlurryAdView checkBannerLocation] in libFlurry.a(FlurryAdView.o) -[FlurryAdView checkBannerLocation] in libFlurry.a(FlurryAdView.o) -[FlurryAdView dealloc] in libFlurry.a(FlurryAdView.o) -[FlurryAdView dealloc] in libFlurry.a(FlurryAdView.o) -[FlurryPageViewDelegate navigationController:didShowViewController:animated:] in libFlurry.a(FlurryPageViewDelegate.o) -[FlurryPageViewDelegate navigationController:didShowViewController:animated:] in libFlurry.a(FlurryPageViewDelegate.o) -[FlurryPageViewDelegate navigationController:willShowViewController:animated:] in libFlurry.a(FlurryPageViewDelegate.o) -[FlurryPageViewDelegate navigationController:willShowViewController:animated:] in libFlurry.a(FlurryPageViewDelegate.o) -[FlurryPageViewDelegate tabBarController:shouldSelectViewController:] in libFlurry.a(FlurryPageViewDelegate.o) -[FlurryPageViewDelegate tabBarController:shouldSelectViewController:] in libFlurry.a(FlurryPageViewDelegate.o) -[FlurryPageViewDelegate tabBarController:didSelectViewController:] in libFlurry.a(FlurryPageViewDelegate.o) -[FlurryPageViewDelegate tabBarController:didSelectViewController:] in libFlurry.a(FlurryPageViewDelegate.o) -[FlurryPageViewDelegate tabBarController:willBeginCustomizingViewControllers:] in libFlurry.a(FlurryPageViewDelegate.o) -[FlurryPageViewDelegate tabBarController:willBeginCustomizingViewControllers:] in libFlurry.a(FlurryPageViewDelegate.o) -[FlurryPageViewDelegate tabBarController:willEndCustomizingViewControllers:changed:] in libFlurry.a(FlurryPageViewDelegate.o) -[FlurryPageViewDelegate tabBarController:willEndCustomizingViewControllers:changed:] in libFlurry.a(FlurryPageViewDelegate.o) -[FlurryPageViewDelegate tabBarController:didEndCustomizingViewControllers:changed:] in libFlurry.a(FlurryPageViewDelegate.o) -[FlurryPageViewDelegate tabBarController:didEndCustomizingViewControllers:changed:] in libFlurry.a(FlurryPageViewDelegate.o) -[FlurryAdCanvasViewController dealloc] in libFlurry.a(FlurryAdCanvasViewController.o) -[FlurryAdCanvasViewController dealloc] in libFlurry.a(FlurryAdCanvasViewController.o) +[FlurryFileCache createInstanceWithApiKey:] in libFlurry.a(FlurryFileCache.o) +[FlurryAdAssignment createInstance] in libFlurry.a(FlurryAdAssignment.o) +[FlurryHeartBeater createAndStartInstance:] in libFlurry.a(FlurryHeartBeater.o) +[FlurryImageCache createInstanceWithFileCache:] in libFlurry.a(FlurryImageCache.o) ".objc_class_name_NSMutableURLRequest", referenced from: literal-pointer@_OBJC@_cls_refs@NSMutableURLRequest in libFlurry.a(FlurryHTTPEater.o) ".objc_class_name_NSRunLoop", referenced from: literal-pointer@_OBJC@_cls_refs@NSRunLoop in libFlurry.a(FlurryHTTPEater.o) ".objc_class_name_NSKeyedUnarchiver", referenced from: literal-pointer@_OBJC@_cls_refs@NSKeyedUnarchiver in libFlurry.a(FlurrySession.o) literal-pointer@_OBJC@_cls_refs@NSKeyedUnarchiver in libFlurry.a(FlurryFileCache.o) ".objc_class_name_NSData", referenced from: literal-pointer@_OBJC@_cls_refs@NSData in libFlurry.a(FlurrySession.o) literal-pointer@_OBJC@_cls_refs@NSData in libFlurry.a(FlurryAdParser.o) ".objc_class_name_NSDate", referenced from: literal-pointer@_OBJC@_cls_refs@NSDate in libFlurry.a(FlurrySession.o) literal-pointer@_OBJC@_cls_refs@NSDate in libFlurry.a(FlurryHTTPEater.o) literal-pointer@_OBJC@_cls_refs@NSDate in libFlurry.a(FlurryAdView.o) literal-pointer@_OBJC@_cls_refs@NSDate in libFlurry.a(FlurryAdImpression.o) literal-pointer@_OBJC@_cls_refs@NSDate in libFlurry.a(FlurryEvent.o) ".objc_class_name_UIBarButtonItem", referenced from: literal-pointer@_OBJC@_cls_refs@UIBarButtonItem in libFlurry.a(FlurryAdCanvasViewController.o) ".objc_class_name_NSURLRequest", referenced from: literal-pointer@_OBJC@_cls_refs@NSURLRequest in libFlurry.a(FlurryAdCanvasViewController.o) literal-pointer@_OBJC@_cls_refs@NSURLRequest in libFlurry.a(FlurryAdAppStoreConnectionDelegate.o) ".objc_class_name_UIDevice", referenced from: literal-pointer@_OBJC@_cls_refs@UIDevice in libFlurry.a(FlurrySession.o) literal-pointer@_OBJC@_cls_refs@UIDevice in libFlurry.a(FlurryAdView.o) ".objc_class_name_UIImageView", referenced from: literal-pointer@_OBJC@_cls_refs@UIImageView in libFlurry.a(FlurryAdView.o) literal-pointer@_OBJC@_cls_refs@UIImageView in libFlurry.a(FlurryAdCanvasViewController.o) literal-pointer@_OBJC@_cls_refs@UIImageView in libFlurry.a(FlurryAdCanvasView.o) "_objc_exception_try_exit", referenced from: +[FlurryAPI startSession:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI endSession] in libFlurry.a(FlurryAPI.o) +[FlurryAPI pauseSession] in libFlurry.a(FlurryAPI.o) +[FlurryAPI resumeSession] in libFlurry.a(FlurryAPI.o) +[FlurryAPI logEvent:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI logEvent:withParameters:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI logEvent:timed:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI logEvent:withParameters:timed:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI endTimedEvent:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI logError:message:exception:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI logError:message:error:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI countPageViews:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI countPageView] in libFlurry.a(FlurryAPI.o) +[FlurryAPI setUserID:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI setEventLoggingEnabled:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI setServerURL:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI setCanvasURL:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI setLandscapeCanvasURL:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI setAppStoreURL:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI setSessionReportsOnCloseEnabled:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI setAppVersion:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI setGender:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI setAge:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI getHook:xLoc:yLoc:view:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI getHook:xLoc:yLoc:view:attachToView:orientation:canvasOrientation:autoRefresh:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI updateHook:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI removeHook:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI openCatalog:canvasOrientation:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI setAppCircleDelegate:] in libFlurry.a(FlurryAPI.o) +[FlurrySession createActiveFlurrySession:] in libFlurry.a(FlurrySession.o) +[FlurrySession createActiveFlurrySession:] in libFlurry.a(FlurrySession.o) +[FlurrySession sendSessionsToServerWithTimeout:useWebView:requestAds:] in libFlurry.a(FlurrySession.o) +[FlurrySession dataForSessions:requestAds:] in libFlurry.a(FlurrySession.o) +[FlurrySession dataForSessions:requestAds:] in libFlurry.a(FlurrySession.o) +[FlurrySession initialTimestamp] in libFlurry.a(FlurrySession.o) +[FlurrySession initialTimestamp] in libFlurry.a(FlurrySession.o) +[FlurrySession initialTimestamp] in libFlurry.a(FlurrySession.o) +[FlurryAdParser oldInstance] in libFlurry.a(FlurryAdParser.o) +[FlurryAdParser instance] in libFlurry.a(FlurryAdParser.o) -[FlurryAdView initWithAd:hook:xLoc:yLoc:parent:attachToView:orientation:canvasOrientation:autoRefresh:] in libFlurry.a(FlurryAdView.o) -[FlurryAdView refreshWithAd] in libFlurry.a(FlurryAdView.o) -[FlurryAdView updateToOrientation] in libFlurry.a(FlurryAdView.o) -[FlurryAdView touchesEnded:withEvent:] in libFlurry.a(FlurryAdView.o) -[FlurryAdView alertView:clickedButtonAtIndex:] in libFlurry.a(FlurryAdView.o) -[FlurryAdView checkBannerLocation] in libFlurry.a(FlurryAdView.o) -[FlurryAdView dealloc] in libFlurry.a(FlurryAdView.o) -[FlurryPageViewDelegate navigationController:didShowViewController:animated:] in libFlurry.a(FlurryPageViewDelegate.o) -[FlurryPageViewDelegate navigationController:willShowViewController:animated:] in libFlurry.a(FlurryPageViewDelegate.o) -[FlurryPageViewDelegate tabBarController:shouldSelectViewController:] in libFlurry.a(FlurryPageViewDelegate.o) -[FlurryPageViewDelegate tabBarController:didSelectViewController:] in libFlurry.a(FlurryPageViewDelegate.o) -[FlurryPageViewDelegate tabBarController:willBeginCustomizingViewControllers:] in libFlurry.a(FlurryPageViewDelegate.o) -[FlurryPageViewDelegate tabBarController:willEndCustomizingViewControllers:changed:] in libFlurry.a(FlurryPageViewDelegate.o) -[FlurryPageViewDelegate tabBarController:didEndCustomizingViewControllers:changed:] in libFlurry.a(FlurryPageViewDelegate.o) -[FlurryAdCanvasViewController dealloc] in libFlurry.a(FlurryAdCanvasViewController.o) +[FlurryFileCache createInstanceWithApiKey:] in libFlurry.a(FlurryFileCache.o) +[FlurryAdAssignment createInstance] in libFlurry.a(FlurryAdAssignment.o) +[FlurryHeartBeater createAndStartInstance:] in libFlurry.a(FlurryHeartBeater.o) +[FlurryImageCache createInstanceWithFileCache:] in libFlurry.a(FlurryImageCache.o) ".objc_class_name_NSDateFormatter", referenced from: literal-pointer@_OBJC@_cls_refs@NSDateFormatter in libFlurry.a(FlurrySession.o) "_objc_exception_try_enter", referenced from: +[FlurryAPI startSession:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI startSession:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI endSession] in libFlurry.a(FlurryAPI.o) +[FlurryAPI endSession] in libFlurry.a(FlurryAPI.o) +[FlurryAPI pauseSession] in libFlurry.a(FlurryAPI.o) +[FlurryAPI pauseSession] in libFlurry.a(FlurryAPI.o) +[FlurryAPI resumeSession] in libFlurry.a(FlurryAPI.o) +[FlurryAPI resumeSession] in libFlurry.a(FlurryAPI.o) +[FlurryAPI logEvent:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI logEvent:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI logEvent:withParameters:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI logEvent:withParameters:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI logEvent:timed:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI logEvent:timed:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI logEvent:withParameters:timed:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI logEvent:withParameters:timed:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI endTimedEvent:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI endTimedEvent:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI logError:message:exception:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI logError:message:exception:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI logError:message:error:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI logError:message:error:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI countPageViews:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI countPageViews:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI countPageView] in libFlurry.a(FlurryAPI.o) +[FlurryAPI countPageView] in libFlurry.a(FlurryAPI.o) +[FlurryAPI setUserID:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI setUserID:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI setEventLoggingEnabled:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI setEventLoggingEnabled:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI setServerURL:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI setServerURL:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI setCanvasURL:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI setCanvasURL:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI setLandscapeCanvasURL:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI setLandscapeCanvasURL:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI setAppStoreURL:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI setAppStoreURL:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI setSessionReportsOnCloseEnabled:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI setSessionReportsOnCloseEnabled:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI setAppVersion:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI setAppVersion:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI setGender:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI setGender:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI setAge:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI setAge:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI getHook:xLoc:yLoc:view:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI getHook:xLoc:yLoc:view:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI getHook:xLoc:yLoc:view:attachToView:orientation:canvasOrientation:autoRefresh:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI getHook:xLoc:yLoc:view:attachToView:orientation:canvasOrientation:autoRefresh:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI updateHook:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI updateHook:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI removeHook:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI removeHook:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI openCatalog:canvasOrientation:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI openCatalog:canvasOrientation:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI setAppCircleDelegate:] in libFlurry.a(FlurryAPI.o) +[FlurryAPI setAppCircleDelegate:] in libFlurry.a(FlurryAPI.o) +[FlurrySession createActiveFlurrySession:] in libFlurry.a(FlurrySession.o) +[FlurrySession createActiveFlurrySession:] in libFlurry.a(FlurrySession.o) +[FlurrySession sendSessionsToServerWithTimeout:useWebView:requestAds:] in libFlurry.a(FlurrySession.o)

    Read the article

  • Replace text in word textbox objects using VSTO and C#

    - by Roberto
    Hi, I have to find/replace text from a word document. It works fine for plain text spread through the document, however when the text is in a textbox, the standard find/replace approach doesn't reach it. I found a vba solution, however since I am working in C#, I would like to find a solution in C#. The word document is in 2007 format and my visual studio is 2010. I am using .Net Framework 3.5, but if required, I can consider moving to 4.0. Here is the code for the find/replace that only works with plain text (not in word textbox objects): object Missing = System.Reflection.Missing.Value; object fileToOpen = (object)@"c:\doc.docx"; object fileToSave = (object)@"c:\doc.docx"; Word.Application app = new Word.ApplicationClass(); Word.Document doc = new Word.Document(); try { doc = app.Documents.Open(ref fileToOpen, ref Missing, ref Missing, ref Missing, ref Missing, ref Missing, ref Missing, ref Missing, ref Missing, ref Missing, ref Missing, ref Missing, ref Missing, ref Missing, ref Missing, ref Missing); object replaceAll = Word.WdReplace.wdReplaceAll; app.Selection.Find.ClearFormatting(); app.Selection.Find.Text = "MyTextForReplacement"; app.Selection.Find.Replacement.ClearFormatting(); app.Selection.Find.Replacement.Text = "Found you!"; app.Selection.Find.Execute( ref Missing, ref Missing, ref Missing, ref Missing, ref Missing, ref Missing, ref Missing, ref Missing, ref Missing, ref Missing, ref replaceAll, ref Missing, ref Missing, ref Missing, ref Missing); I also tried using the below code, but didn't work as well: foreach(Word.Shape s in app.ActiveDocument.Shapes) { if(s.TextFrame.HasText >= 1) //The value is always 0 or -1, and even leaving 0 go forward, // it doesn't work, because there is no text in there... { foreach(Word.Field f in s.TextFrame.TextRange.Fields) { switch( f.Type) { . . //I never reached this point . } } } Any help will be appreciated... Thanks, -- Roberto Lopes

    Read the article

  • C Programming: malloc() for a 2D array (using pointer-to-pointer)

    - by vikramtheone
    Hi Guys, yesterday I had posted a question: How should I pass a pointer to a function and allocate memory for the passed pointer from inside the called function? From the answers I got, I was able to understand what mistake I was doing. I'm facing a new problem now, can anyone help out with this? I want to dynamically allocate a 2D array, so I'm passing a Pointer-to-Pointer from my main() to another function called alloc_2D_pixels(...), where I use malloc(...) and for(...) loop to allocate memory for the 2D array. Well, after returning from the alloc_2D_pixels(...) function, the pointer-to-pointer still remains NULL, so naturally, when I try accessing or try to free(...) the Pointer-to-Pointer, the program hangs. Can anyone suggest me what mistakes I'm doing here? Help!!! Vikram SOURCE: main() { unsigned char **ptr; unsigned int rows, cols; if(alloc_2D_pixels(&ptr, rows, cols)==ERROR) // Satisfies this condition printf("Memory for the 2D array not allocated"); // NO ERROR is returned if(ptr == NULL) // ptr is NULL so no memory was allocated printf("Yes its NULL!"); // Because ptr is NULL, with any of these 3 statements below the program HANGS ptr[0][0] = 10; printf("Element: %d",ptr[0][0]); free_2D_alloc(&ptr); } signed char alloc_2D_pixels(unsigned char ***memory, unsigned int rows, unsigned int cols) { signed char status = NO_ERROR; memory = malloc(rows * sizeof(unsigned char** )); if(memory == NULL) { status = ERROR; printf("ERROR: Memory allocation failed!"); } else { int i; for(i = 0; i< cols; i++) { memory[i] = malloc(cols * sizeof(unsigned char)); if(memory[i]==NULL) { status = ERROR; printf("ERROR: Memory allocation failed!"); } } } // Inserted the statements below for debug purpose only memory[0][0] = (unsigned char)10; // I'm able to access the array from printf("\nElement %d",memory[0][0]); // here with no problems return status; } void free_2D_pixels(unsigned char ***ptr, unsigned int rows) { int i; for(i = 0; i < rows; i++) { free(ptr[i]); } free(ptr); }

    Read the article

  • C - Complicated pointer declarations - help understanding

    - by Emmel
    In my burgeoning new self-education in the C language, I've come across a set of declarations that I do not understand how to read. I'd love for someone to break these down. I'll explain at the bottom where I got these examples from. 1. char (*(*x())[])() "x: function returning pointer to array[] of pointer to function returning char" - huh? 2. char (*(*x[3])())[5] "x: array[3] of pointer to function returning pointer to array[5] of char" - come again? 3. char **argv This I understand. "Pointer to pointer to char." But what I don't understand is -- what's the use case for a pointer to a pointer? Follow-up question: does anyone every use declarations this complex or is this just academic fun on the part of the authors of the examples I got this from? These examples are from section 5.12 of the K&R book. This is the first time I'm genuinely stumped by an explanation, in an otherwise well-written classic. Thanks.

    Read the article

  • Pointer incrementing query

    - by Craig
    I have been looking at this piece of code, and it is not doing what I expect. I have 3 globals. int x, y, *pointer, z; Inside of main I declare them. x = 10; y = 25; pointer = &x; now at this point &x is 0x004A144 &y is 0x004A138 pointer is pointing to 0x004A144 Now when I increment: y = *++pointer; it points to 0x004A148, this is the address y should be at shouldn't it? The idea is that incrementing the pointer to 'x' should increment it to point at y, but it doesn't seem to want to declare them in in order like I expect. If this a VS2005 / 2008 problem? Or maybe an Express problem? This isn't really homework, as I have done it a couple of years ago but I was revising on my pointer stuff and I tried this again. But this time I am getting unexpected results. Does anyone have opinions on this? *UPDATE sorry should be more clear, 'thought' on declaration 'y' should be at 148, and that incrementing the pointer pointing to x should increment 'pointer' to 148 (which it does), but that isn't where y is. Why isn't y declaring where it should be.

    Read the article

  • Dereferencing the null pointer

    - by zilgo
    The standard says that dereferencing the null pointer leads to undefined behaviour. But what is "the null pointer"? In the following code, what we call "the null pointer": struct X { static X* get() { return reinterpret_cast<X*>(1); } void f() { } }; int main() { X* x = 0; (*x).f(); // the null pointer? (1) x = X::get(); (*x).f(); // the null pointer? (2) x = reinterpret_cast<X*>( X::get() - X::get() ); (*x).f(); // the null pointer? (3) (*(X*)0).f(); // I think that this the only null pointer here (4) } My thought is that dereferencing of the null pointer takes place only in the last case. Am I right? Is there difference between compile time null pointers and runtime according to C++ Standard?

    Read the article

  • CorePlot linker errors after upgrading iOS SDK

    - by JustinXXVII
    This seems like it's happened before but somehow ended up working itself out. It's happened again and I can't seem to get this fixed. I use the CorePlot Cocoa Touch framework. Everything was fine until I upgraded to the new 4.3 beta. Now my project won't compile, and is giving me linker errors for unknown symbols having to do with CorePlot. I've become a pro at adding the framework to my project, and I've checked and rechecked the instructions trying to do it again. Is there a button I can click or anything to just make this work again? I've used these instructions to try to re-add the framework, to no avail EDIT: By the way, this compiles just fine for simulator and runs graphs no problem. Compiling for the device gives me the linker errors, as follows: "_OBJC_CLASS_$_CPPlotRange", referenced from: objc-class-ref in GraphStatsWindow.o objc-class-ref in iPadGraphView.o objc-class-ref in GraphTrendView.o "_OBJC_CLASS_$_CPXYGraph", referenced from: objc-class-ref in GraphStatsWindow.o objc-class-ref in iPadGraphView.o objc-class-ref in GraphTrendView.o "_OBJC_CLASS_$_CPTextStyle", referenced from: objc-class-ref in GraphStatsWindow.o objc-class-ref in iPadGraphView.o objc-class-ref in GraphTrendView.o "_OBJC_CLASS_$_CPLineStyle", referenced from: objc-class-ref in GraphStatsWindow.o objc-class-ref in iPadGraphView.o objc-class-ref in GraphTrendView.o "_OBJC_CLASS_$_CPScatterPlot", referenced from: objc-class-ref in GraphStatsWindow.o objc-class-ref in iPadGraphView.o objc-class-ref in GraphTrendView.o "_OBJC_CLASS_$_CPAxisLabel", referenced from: objc-class-ref in GraphStatsWindow.o objc-class-ref in iPadGraphView.o objc-class-ref in GraphTrendView.o "_OBJC_CLASS_$_CPPlotSymbol", referenced from: objc-class-ref in GraphStatsWindow.o objc-class-ref in iPadGraphView.o objc-class-ref in GraphTrendView.o "_OBJC_CLASS_$_CPColor", referenced from: objc-class-ref in GraphStatsWindow.o objc-class-ref in iPadGraphView.o objc-class-ref in GraphTrendView.o "_OBJC_CLASS_$_CPFill", referenced from: objc-class-ref in GraphStatsWindow.o objc-class-ref in iPadGraphView.o objc-class-ref in GraphTrendView.o "_CPDecimalFromFloat", referenced from: -[GraphStatsWindow setNewGraph] in GraphStatsWindow.o -[iPadGraphView viewDidLoad] in iPadGraphView.o -[GraphTrendView setNewGraph] in GraphTrendView.o "_kCPPlainWhiteTheme", referenced from: -[GraphStatsWindow setNewGraph] in GraphStatsWindow.o -[iPadGraphView viewDidLoad] in iPadGraphView.o -[GraphTrendView setNewGraph] in GraphTrendView.o "_OBJC_CLASS_$_CPTheme", referenced from: objc-class-ref in GraphStatsWindow.o objc-class-ref in iPadGraphView.o objc-class-ref in GraphTrendView.o ld: symbol(s) not found for architecture armv7

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >