<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: einvalidInput  while invoking Application.Invoke(rb) in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/einvalidinput-while-invoking-application-invoke-rb/m-p/7040840#M31812</link>
    <description>&lt;P&gt;You don't pass the name of the C++ function to Invoke(), you pass the name that you used with &lt;STRONG&gt;acedDefun()&lt;/STRONG&gt; to register the C++ function as callable from LISP or acedInvoke() or Application.Invoke().&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That's assuming of course, that you used &lt;STRONG&gt;acedDefun&lt;/STRONG&gt;() (or the ObjectARX wizard) to register the function in the first place. &amp;nbsp;Did you?&lt;/P&gt;</description>
    <pubDate>Tue, 25 Apr 2017 15:04:32 GMT</pubDate>
    <dc:creator>ActivistInvestor</dc:creator>
    <dc:date>2017-04-25T15:04:32Z</dc:date>
    <item>
      <title>einvalidInput  while invoking Application.Invoke(rb)</title>
      <link>https://forums.autodesk.com/t5/net-forum/einvalidinput-while-invoking-application-invoke-rb/m-p/7039927#M31811</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;In an ARX file we have the below code :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;int upd_text(void)
{
acutPrintf(L"\nInside upd_text.\n");
ads_name ENT;
struct resbuf *RB, *ARGS;
// RB = ads_newrb(RTSTR);
RB = acutNewRb(RTSTR);
// ARGS = ads_getargs();
ARGS = acedGetArgs();
if (ARGS) {
ENT[0] = ARGS-&amp;gt;resval.rlname[0];
ENT[1] = ARGS-&amp;gt;resval.rlname[1];
} else {
// if ((RESULT = ads_entlast(ENT)) != RTNORM) {
if ((RESULT = acdbEntLast(ENT)) != RTNORM) {
// ads_printf(L"\nCannot find entity in drawing database.\n");
acutPrintf(L"\nCannot find entity in drawing database.\n");
return RESULT;
}
}
// if ((RESULT = ads_getvar(L"CECOLOR",RB)) != RTNORM) {
if ((RESULT = acedGetVar(L"CECOLOR",RB)) != RTNORM) {
// ads_printf(L"\nCannot get current color.\n");
acutPrintf(L"\nCannot get current color.\n");
return RESULT;
}
if ((!wcscmp(RB-&amp;gt;resval.rstring, L"1")) ||
(!wcscmp(RB-&amp;gt;resval.rstring, L"2")) ||
(!wcscmp(RB-&amp;gt;resval.rstring, L"3"))) {
upd_color(ENT,-1,0, L"BAY", L"*");
upd_color(ENT,-1,0, L"GRP_CODE", L"*");
}
// ads_relrb(RB);
acutRelRb(RB);
// ads_retvoid();
acedRetVoid();
return RTNORM;
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From VB.NET we are invoking it as below :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Public Shared Function upd_text(objID As ObjectId) As Integer
Dim doc As Document = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument
Dim ed As Editor = doc.Editor
Using dl As DocumentLock = doc.LockDocument()
Using rb As New ResultBuffer()
rb.Add(New TypedValue(CInt(LispDataType.Text), "upd_text"))
rb.Add(New TypedValue(CInt(LispDataType.ObjectId), objID))
Dim rbRes As ResultBuffer = Application.Invoke(rb)
End Using
End Using
&amp;nbsp;
End Function&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We are getting the below error :&lt;BR /&gt;Autodesk.AutoCAD.Runtime.Exception: eInvalidInput&lt;BR /&gt;at Autodesk.AutoCAD.ApplicationServices.Core.Application.Invoke(ResultBuffer args)&lt;BR /&gt;at GSITE_NIMCAD.ARXWRAPPER.upd_text(ObjectId objID) in D:\Application Data\GSITE\Working 2017 Migration\GSITE_NIMCAD\ACAD_Mgr\ARXWRAPPER.vb:line 393&lt;BR /&gt;at GSITE_NIMCAD.GSITE_NIMCAD.Draft.add_blck(String bdir, String blk, Double rot, Double sc, Point3d insPoint) in D:\Application Data\GSITE\Working 2017 Migration\GSITE_NIMCAD\Draft\Draft.vb:line 1570&lt;BR /&gt;at GSITE_NIMCAD.GSITE_NIMCAD.Nimcad.mnuAddSym(ResultBuffer args) in D:\Application Data\GSITE\Working 2017 Migration\GSITE_NIMCAD\Nimcad.vb:line 2617&lt;BR /&gt;at GSITE_NIMCAD.GSITE_NIMCAD.NIMCAD_Commands.CMD_Lu_FloPlaInfoReCir() in D:\Application Data\GSITE\Working 2017 Migration\GSITE_NIMCAD\Commands\NIMCAD_Commands.vb:line 955&lt;BR /&gt;at Autodesk.AutoCAD.Runtime.CommandClass.InvokeWorker(MethodInfo mi, Object commandObject, Boolean bLispFunction)&lt;BR /&gt;at Autodesk.AutoCAD.Runtime.CommandClass.InvokeWorkerWithExceptionFilter(MethodInfo mi, Object commandObject, Boolean bLispFunction)&lt;BR /&gt;at Autodesk.AutoCAD.Runtime.CommandClass.CommandThunk.Invoke()&lt;/P&gt;&lt;P&gt;Could anybody explain why is this. It is working fine in AutoCad 2014. We are now upgrading it to AutoCad 2018.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also We have another code :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt; Dim cmdTTEXT As String = "(TTEXT " + scal + " )" + vbCr   '(TTEXT scal)
                Application.DocumentManager.MdiActiveDocument.SendStringToExecute(cmdTTEXT, True, False, False) '(command "dtext")&lt;/PRE&gt;&lt;P&gt;Here we are getting&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;error: no function definition: TTEXT&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is TTEXT deprecated. If so which function should we use. Please guide.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in Advance&lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2017 09:21:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/einvalidinput-while-invoking-application-invoke-rb/m-p/7039927#M31811</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-04-25T09:21:33Z</dc:date>
    </item>
    <item>
      <title>Re: einvalidInput  while invoking Application.Invoke(rb)</title>
      <link>https://forums.autodesk.com/t5/net-forum/einvalidinput-while-invoking-application-invoke-rb/m-p/7040840#M31812</link>
      <description>&lt;P&gt;You don't pass the name of the C++ function to Invoke(), you pass the name that you used with &lt;STRONG&gt;acedDefun()&lt;/STRONG&gt; to register the C++ function as callable from LISP or acedInvoke() or Application.Invoke().&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That's assuming of course, that you used &lt;STRONG&gt;acedDefun&lt;/STRONG&gt;() (or the ObjectARX wizard) to register the function in the first place. &amp;nbsp;Did you?&lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2017 15:04:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/einvalidinput-while-invoking-application-invoke-rb/m-p/7040840#M31812</guid>
      <dc:creator>ActivistInvestor</dc:creator>
      <dc:date>2017-04-25T15:04:32Z</dc:date>
    </item>
    <item>
      <title>Re: einvalidInput  while invoking Application.Invoke(rb)</title>
      <link>https://forums.autodesk.com/t5/net-forum/einvalidinput-while-invoking-application-invoke-rb/m-p/7041250#M31813</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes we are doing that in arxentrypoint.cpp file as shown below :&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;static func_entry func_table[] = {
	{ L"blupdate",blupdate },{ L"partialupdate",partialupdate },
	{ L"upd_text",upd_text },{ L"check_ver",check_ver },
	{ L"upd1_2",upd1_2 },{ L"move_sheet",move_sheet },{ L"insert_sk",insert_sk }
	
};

static int funcload()
{
	short i = sizeof(func_table) / sizeof(func_entry);
	while (i--) {
		if (!acedDefun(func_table[i].func_name, i))
			return RTERROR;
	}
	return RTNORM;
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;funcload() was not called in&amp;nbsp;On_kLoadDwgMsg that was the problem. Now it is working fine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2017 17:05:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/einvalidinput-while-invoking-application-invoke-rb/m-p/7041250#M31813</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-04-25T17:05:30Z</dc:date>
    </item>
  </channel>
</rss>

