Thread: why this function is not working

  1. #1
    Registered User
    Join Date
    Dec 2007
    Posts
    78

    Unhappy why this function is not working

    hi friends!

    i am trying to replace & add the strings using
    "UF_MODL_replace_feat_strings" function
    but somehow the function is not working...
    can anyone suggest any solution?

    my code:


    Code:
    void defGeometry::ReplaceSpline(std::vector<struct geometricSection>sections)
    {
    	int j=1;	
    	tag_t PartTag=NULL_TAG;
    	tag_t feat_tag=NULL_TAG;
    	char feat_name[]="THROUGH";
    	UF_STRING_p_t  sectionEditData;
    	sectionEditData=new UF_STRING_t ;
    	tag_t  feature_id;
    	//sectionEditData= (UF_STRING_t *) malloc (sizeof(UF_STRING_t)*ActionSide.NumberOfSections);
    	PartTag=UF_PART_ask_display_part();
    	UF_CALL(UF_OBJ_cycle_by_name_and_type (PartTag, feat_name, UF_feature_type, FALSE, &feat_tag));
    	if(!feat_tag)
    	{
    		sysLogPrint("Failed to find feature tag!");
    	}
    	else
    	{
    		sysLogPrint("Feature Tag=&#37;d\n\n",feat_tag);
    	}
    
    	UF_CALL(UF_MODL_ask_current_feature (PartTag, &feature_id ));
    
    	UF_CALL(UF_MODL_set_current_feature (feat_tag ));
    
    	for(int i=0;i<ActionSide.NumberOfSections;i++ )
    	{
    		int k;
    		UF_MODL_init_string_list(&sectionEditData[i]);
    		UF_MODL_create_string_list(1, 4, &sectionEditData[i]);
    		sectionEditData[i].string[0]=4;
    		sectionEditData[i].dir[0]=UF_MODL_CURVE_START_FROM_BEGIN;
    		for(k=1;k<5;k++)
    			{
    				sectionEditData[i].id[k]=sections[i].section_tags[k];
    				
    			}
    		if(j<=3)
    		{
    			if(!UF_CALL(UF_MODL_replace_feat_strings (feat_tag,UF_MODL_STRING_REPLACE,&sectionEditData[i],1,j++)))
    			{
    				sysLogPrint("spline removed j<=3\n");
    			}
    			else
    			{
    				sysLogPrint("spline not removed \n");
    			}
    		}
    		else
    		{
    			
    			if(!UF_CALL(UF_MODL_replace_feat_strings (feat_tag, UF_MODL_STRING_ADD, &sectionEditData[i], 1, (j++)-1)))
    			{
    				sysLogPrint("spline add \n");
    			}
    			else
    			{
    				sysLogPrint("spline not add\n");
    			}
    		}
    	}
    	if(!UF_CALL(UF_MODL_set_update_fail_option(UF_MODL_UPDATE_ACCEPT)))
    	{
    		sysLogPrint("modl update sucess with accept option\n");
    	}
    	else
    	{
    		sysLogPrint("modl update failed with accept option\n");
    	}
    	if(!UF_CALL(UF_MODL_update ()))
    	{
    		sysLogPrint("update sucess\n");
    	}
    	else
    	{
    		sysLogPrint("update failed\n");
    	}
    	UF_MODL_free_string_list (sectionEditData);
    };
    Last edited by chintugavali; 01-06-2008 at 10:27 PM.

  2. #2
    Algorithm Dissector iMalc's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    6,318
    I haven't heard of UF_MODL and I doubt many other people have either.

    Does this documentation (found by googling) help you?
    http://www.kxcad.net/ugs/UGDOC/html_...odl/index.html

    If not, then you're unlikely to find answers here.
    My homepage
    Advice: Take only as directed - If symptoms persist, please see your debugger

    Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"

  3. #3
    Registered User
    Join Date
    Dec 2007
    Posts
    78

    Smile

    thanks for that link!!

    but i want to find out whether i have done some c ++ related error?

  4. #4
    Registered User
    Join Date
    Dec 2007
    Posts
    78
    while debugging when i come to this line:
    UF_CALL(UF_MODL_replace_feat_strings )

    i got this error in the stack
    error 875184

    can yout tell what is this error?

  5. #5
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    Quote Originally Posted by chintugavali View Post
    while debugging when i come to this line:
    UF_CALL(UF_MODL_replace_feat_strings )

    i got this error in the stack
    error 875184

    can yout tell what is this error?
    No.

    I've seen you give full compiler error messages before; what happened here? Or is this a run-time error generated by this modeling package thing that you're using? (If so, you're going to have to bother UF, or whoever.) Or, if it's thrown by the debugger, you'll have to look at your debugger documentation.

  6. #6
    Registered User
    Join Date
    Dec 2007
    Posts
    78
    thanks tabstop!

    full compiler error messages :

    Code:
    report_error returned	875184	int
    
    
    
    -this	0x0012f708 {Section1={...} Section2={...} Section3={...} ...}	defGeometry * const
    +		defFile	{Path="" PathAndFile="" DefFileName=0xcccccccc <Bad Ptr> ...}	defFile
    +		Section1	{Name=0x0012f7cc "&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;" NumberOfPoints=-858993460 Points=[0]() }	Section
    +		Section2	{Name=0x0012f8e4 "&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;" NumberOfPoints=-858993460 Points=[0]() }	Section
    +		Section3	{Name=0x0012f9fc "&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;" NumberOfPoints=-858993460 Points=[0]() }	Section
    +		Section4	{Name=0x0012fb14 "&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;" NumberOfPoints=-858993460 Points=[0]() }	Section
    +		TempdefGeomSec	{Name=0x0012fc2c "&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;" NumberOfPoints=-858993460 Points=[0]() }	Section
    		nthN1Point	10	int
    		nthN2Point	10	int
    +		FileName	0x0012fd4c "&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;&#204;"	char [256]
    		FileTag	3435973836	unsigned int
    +		sections	[8]({section_tags=[4]((1,10090),(2,10089),(3,10088),(4,10091)) },{section_tags=[4]((1,10094),(2,10092),(3,10093),(4,10095)) },...)	std::vector<geometricSection,std::allocator<geometricSection> >

  7. #7
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    Code:
    <Bad Ptr>
    I'd say.

    My Hat of Guessing tells me that "this" is the defGeometry object you're calling the function from? If so, that doesn't look like it's a fully valid object, unless all those things are supposed to be 256 accented I's. (The fact that the ASCII code for that character is 0xCC -- I had to look that up -- makes me more suspicious.) Perhaps you should check where this function is being called from? Maybe you're walking off the end of an array.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. In over my head
    By Shelnutt2 in forum C Programming
    Replies: 1
    Last Post: 07-08-2008, 06:54 PM
  2. Problem with Visual C++ Object-Oriented Programming Book.
    By GameGenie in forum C++ Programming
    Replies: 9
    Last Post: 08-29-2005, 11:21 PM
  3. C++ compilation issues
    By Rupan in forum C++ Programming
    Replies: 1
    Last Post: 08-22-2005, 05:45 AM
  4. structure vs class
    By sana in forum C++ Programming
    Replies: 13
    Last Post: 12-02-2002, 07:18 AM
  5. I need help with passing pointers in function calls
    By vien_mti in forum C Programming
    Replies: 3
    Last Post: 04-24-2002, 10:00 AM