ICE

Please login or register.

Login with username, password and session length
Advanced search  

News:

ICETCP.PRO and ICETCP.PLUS are compatible with Windows 11!

Pages: 1 2 [3]

Author Topic: OLE-API Questions  (Read 18743 times)

jwf

  • Full Member
  • ***
  • Posts: 11
  • Place Personal Text Here
Re:OLE-API Questions
« Reply #30 on: September 29, 2005, 04:21:12 pm »

Okay, not having super luck with this.  Is it possible to get the IDL definitions for SetProfile and GetProfile?

is GetProfile: GetProfile([in, out] VARIANT...
or GetProfile([out] VARIANT

I assume that it expects/produces (whichever) a safearray containing a V_RECORD?

I assume that SetProfile and Connect use ([in] VARIANT...)
Logged

Bob

  • Administrator
  • Ice Artist
  • *****
  • Posts: 1607
OLE-API Questions
« Reply #31 on: September 29, 2005, 04:43:48 pm »

I'll check and get back to you. It may not be until Monday.
Logged

Bob

  • Administrator
  • Ice Artist
  • *****
  • Posts: 1607
OLE-API Questions
« Reply #32 on: October 03, 2005, 02:06:40 pm »

Here is how the container does it. Hope this helps....

This code Copyright(C) Jriver, Inc. All rights reserved.

TelnetPro.exe code:

void CAquarius::Connect(BSTR* Host, const VARIANT& Profile)
{
        static BYTE parms[] = VTS_PBSTR VTS_VARIANT;
        InvokeHelper(0x53, DISPATCH_METHOD, VT_EMPTY, NULL, parms, Host, &Profile);
}

void CAquarius::GetProfile2(const VARIANT& l_Profile)
{
        static BYTE parms[] = VTS_VARIANT;
        InvokeHelper(0x54, DISPATCH_METHOD, VT_EMPTY, NULL, parms, &l_Profile);
}

void CAquarius::SetProfile2(const VARIANT& l_Profile)
{
        static BYTE parms[] = VTS_VARIANT;
        InvokeHelper(0x55, DISPATCH_METHOD, VT_EMPTY, NULL, parms, &l_Profile);
}


----------------------------------

OCX Code:

/////////////////////////////////////////////////////////////////////////////
//
// Function:    SetProfile/GetProfile
//
// Purpose:             These are the methods to get and set the profile property.
//
// Comments:    I couldn't figure out how to pass any type I wanted, so I
//                              chose LPCTSTR, cast a pointer to a ProfileData object to
//                              LPCTSTR before calling and it should work fine.
//
/////////////////////////////////////////////////////////////////////////////

void CAquariusCtrl::SetProfile(const VARIANT FAR& Profile)
{
        void *pArrayData;
        PassProfile     TempPassProfile;
   
        SafeArrayAccessData(Profile.parray, &pArrayData);
        CopyMemory(&TempPassProfile, pArrayData, sizeof(PassProfile));
        SafeArrayUnaccessData(Profile.parray);

        // TODO:  Write code to check the profile for reasonable values.
        int iPassProfileReturn = IsPassProfileValid(&TempPassProfile);
        if (0 == iPassProfileReturn)
        {
                ProfileData     OldProfile = *m_Profile;
                m_Profile->SetPassProfile(&TempPassProfile);

                // Check for actions that need to be taken based on differences
                // in new and old profiles.
                ActOnNewProfile(&OldProfile, m_Profile);
        } //
        else
        {
                DejaTrace(sevError,traceProfile,"Pass Profile is invalid, bad field =%d.\n", iPassProfileReturn);
        } // else

} // CAquariusCtrl::SetProfile

void CAquariusCtrl::GetProfile(const VARIANT FAR& l_Profile)
{

        void *pArrayData;
        PassProfile     TempPassProfile;

        SafeArrayAccessData(l_Profile.parray, &pArrayData);
        TempPassProfile = m_Profile->GetPassProfile();
        CopyMemory(pArrayData, &TempPassProfile, sizeof(PassProfile));
        SafeArrayUnaccessData(l_Profile.parray);
} // CAquariusCtrl::GetProfile

///////////////////////////////
void CAquariusCtrl::Connect(BSTR FAR* Host, const VARIANT FAR& Profile)
{
....
}



/////////////////////////////////////
header file declarations:

        afx_msg void Connect(BSTR FAR* Host, const VARIANT FAR& Profile);
        afx_msg void GetProfile(const VARIANT FAR& l_Profile);
        afx_msg void SetProfile(const VARIANT FAR& l_Profile);

/////////////////////////////////////
Dispatch calls:

        DISP_FUNCTION(CAquariusCtrl, "Connect", Connect, VT_EMPTY, VTS_PBSTR, VTS_VARIANT)
        DISP_FUNCTION(CAquariusCtrl, "GetProfile", GetProfile, VT_EMPTY, VTS_VARIANT)
        DISP_FUNCTION(CAquariusCtrl, "SetProfile", SetProfile, VT_EMPTY, VTS_VARIANT)
Logged

BGA

  • Newbie
  • *
  • Posts: 1
  • Place Personal Text Here
Re:OLE-API Questions
« Reply #33 on: October 19, 2005, 09:34:52 pm »

How do I hide the status area at the bottom of the terminal screen ? or change it to a different color other than white.

cheers.
Logged

Bob

  • Administrator
  • Ice Artist
  • *****
  • Posts: 1607
OLE-API Questions
« Reply #34 on: October 20, 2005, 09:52:26 am »

Is this an API question??

If not, the status bar appears as it normally would on a 24 line terminal (you must be in 24 line mode). To change the color in the PRO client, edit the colors in the profile, the status line is one of the things you can change under appearance as label foreground and label background
Logged

Bob

  • Administrator
  • Ice Artist
  • *****
  • Posts: 1607
Re: OLE-API Questions, workaround for easily setting the terminal type, etc.
« Reply #35 on: January 29, 2008, 03:54:11 pm »

You can set the terminal type in the default profile without dealing with the profile variant. You can do a connect/set term type/disconnect/reconnect

This will use the terminal type set during the first (essentially instantaneous) open/close. In VB code it looks like this:

        vProfile = Null
        ' set the font
        DejaVu.Font.Name = "ICE 437"
        ' connect to the host
        Call DejaVu.Connect(sHostName, vProfile)
        ' set terminal type to att605
        Call DejaVu.SetTerminalType(3)
        ' disconnect from the host
        Call DejaVu.Disconnect
        ' reconnect to the host (using previously set terminal type)
        Call DejaVu.Connect(sHostName, vProfile)
        ' enable color mapping
        DejaVu.ColorMappingFlag = True
        ' set normal foreground to cyan
        Call DejaVu.SetColor(1, 3)
        ' set normal background to black
        Call DejaVu.SetColor(2, 0)
        ' clear the screen with the new colors
        Call DejaVu.ResetTerminal

Logged

jimn

  • Global Moderator
  • Ice Artist
  • *****
  • Posts: 116
Re: OLE-API Questions
« Reply #36 on: August 19, 2008, 02:12:05 pm »

Connecting with SSH:

On the Connect call, add "++ssh" (no quotes) to the host name.
Logged
Pages: 1 2 [3]
 

Page created in 0.052 seconds with 20 queries.