This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Monday, March 3, 2008 10:25:46 PM(UTC)
Groups: Registered
Posts: 13
LAnnStamp *ImgStamp = new LAnnStamp();
memset(&NameOptions, 0, sizeof(ANNNAMEOPTIONS));
NameOptions.uStructSize = sizeof(ANNNAMEOPTIONS);
NameOptions.uFlags = ANNNAME_NAME_LENGTH;
ImgStamp->GetNameOptions(&NameOptions, sizeof(ANNNAMEOPTIONS));
NameOptions.bShowName = FALSE;
NameOptions.bNameRestrict = FALSE;
NameOptions.pszName = (L_TCHAR *)malloc(lstrlen(TEXT("Checked"))+1);
lstrcpy(NameOptions.pszName, TEXT("Checked"));
NameOptions.uNameLen = lstrlen(TEXT("Checked"));
NameOptions.uFlags = ANNNAME_NAME | ANNNAME_RESTRICT | ANNNAME_SHOW_NAME;
ImgStamp->SetNameOptions(&NameOptions, 0);
Setting is already to AnnObject.
////////////////////////////////////////////////////////////////////////Get Method
ANNHITTESTINFO HitTestInfo;
nStart.x = LOWORD(lParam);
nStart.y = HIWORD(lParam);
nReturnType = 0;
memset(&HitTestInfo, 0, sizeof(ANNHITTESTINFO));
HitTestInfo.uStructSize = sizeof(ANNHITTESTINFO);
ThisAnno = pTheApp->m_LUserBWnd.GetContainerObject().HitTest(&nStart, &nResultType,
&HitTestInfo, sizeof(ANNHITTESTINFO));
nReturnType = ThisAnno->GetType();
if(nReturnType == ANNOBJECT_STAMP){
ANNNAMEOPTIONS NameOptions;
memset(&NameOptions, 0, sizeof(ANNNAMEOPTIONS));
NameOptions.uStructSize = sizeof(ANNNAMEOPTIONS);
NameOptions.uFlags = ANNNAME_NAME_LENGTH;//ANNNAME_NAME_LENGTH;
nRet = ThisAnno->GetNameOptions(&NameOptions, sizeof(ANNNAMEOPTIONS));
strName.Format(TEXT("%s"), NameOptions.pszName);
AfxMessage(strName);
}
strName is NULL value.
I wants to get setting name 'Checked'.
how??
#2
Posted
:
Tuesday, March 4, 2008 5:40:59 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
Can you
put your code in a small project (not your full application) that shows the
issue and send it to me in a ZIP or RAR file. Also, specify which version (14
or 15) of LEADTOOLS C++ Classes you are using.
#3
Posted
:
Tuesday, March 4, 2008 7:10:00 PM(UTC)
Groups: Registered
Posts: 13
Leadtools Document Image 15 Versions, and I have unlock key for document image(client license).
This sample code is used MSVC 6(ActiveX).
I maked 2 Sample code.(html, ActiveX)
Compile SampleStampCode. and then, Open UserStampSample.html -> open image file -> Button click(UserAnnSet) ->
draw Annotation -> dblClick Annotation -> message box is Null Value from ANNNAMEOPTIONS.pszName~~~
Pelase, Check it.
Thanks for your kind.!
#4
Posted
:
Thursday, March 6, 2008 3:48:05 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
I added the code below and I was able to get the name in the Messagebox, Please try to add this code in your project after you call this line:
nRet = ThisAnno->GetNameOptions(&NameOptions, sizeof(ANNNAMEOPTIONS));
====================
L_TCHAR *pName;
if(NameOptions.uNameLen>0)
{
pName = (L_TCHAR *)GlobalAlloc(GMEM_MOVEABLE|GMEM_ZEROINIT,sizeof(L_TCHAR)*NameOptions.uNameLen+1));
if(pName)
{
NameOptions.uFlags = ANNNAME_NAME;
NameOptions.pszName = pName;
nRet = ThisAnno->GetNameOptions(&NameOptions, sizeof(ANNNAMEOPTIONS));
strName.Format(TEXT("%s"), NameOptions.pszName);
AfxMessageBox(NameOptions.pszName);
GlobalFree(pName);
}
}
==================
#5
Posted
:
Thursday, March 6, 2008 3:28:05 PM(UTC)
Groups: Registered
Posts: 13
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.