Click here to Skip to main content
15,890,123 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
Hi I want to use external dll file to get information about remaining ribbon in my printer

there is a function in this exported dll do that in VC6 ..how can I convert this function to use it in my VB.Net project

in vc6 it just like this:
HITI_GetDeviceInfoW(0, 4, (unsigned char *)dataArray, &dwLen)

thanks


void CTestDevInfoDlg::OnBtnGetRibbonInfo()
{

DWORD dwRet = 0;
DWORD dataArray[32] = {0};
DWORD dwLen = 0;
TCHAR szType[32] = {0};
TCHAR szCount[32] = {0};

dwRet = HITI_GetDeviceInfoW(0, 4, (unsigned char *)dataArray, &dwLen);

if ( dwRet == 0 )
{
_stprintf(szType, _T("%d"), dataArray[0]);
m_EditRibbonType.SetWindowText(szType);
_stprintf(szCount, _T("%d"), dataArray[1]);
m_EditRibbonCount.SetWindowText(szCount);
}
else
{
_stprintf(szType, _T("Error code = %d"), dwRet);
MessageBox(szType, _T("OnBtnGetRibbonInfo"), MB_OK);
}
}
Posted

1 solution

With DllImport and here is a Sample Project with the use of it.

Pay attention to your char* parameter.
 
Share this answer
 
Comments
micmdk 19-Oct-15 8:53am    
Ok I have an idea about this but I have some problems with type of parameters
so I put the small function in my question if you can help me in this
thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900