Hi Cédric Moonen Thanks a lot of your valuable reply
-kk.tvm-
Hi Cédric Moonen Thanks a lot of your valuable reply
-kk.tvm-
Hi Cédric Moonen ok, i want to write code to scroll the image. what i mean.... Scrollbar is properly shown with control. But when i press arrow heads (left or right) or thumb it does not move or changed, like disabled. thanks in advance
-kk.tvm-
Hi Cédric Moonen, Basically my class is subclass of CStatic. I set scrollinfo using below code
void CImageViewer::PreSubclassWindow()
{
CRect rect;
GetClientRect( &rect );
// set horizontal scroll bar
SCROLLINFO si;
ZeroMemory( &si, sizeof( SCROLLINFO ));
si.cbSize = sizeof( SCROLLINFO );
si.fMask = SIF\_ALL;
si.nMin = 0;
si.nMax = nScrWidth;
si.nPage = rect.Width();
si.nPos = 0;
si.nTrackPos = 0;
SetScrollInfo( SB\_HORZ, &si );
CStatic::PreSubclassWindow();
}
and handled OnHScroll Message
void CImageViewer::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
SCROLLINFO si;
int nScrollPos = nPos;
pScrollBar->GetScrollInfo( &si );
int nCurPos = si.nPos;
int nMin = si.nMin;
int nMax = si.nMax;
switch( nSBCode )
{
case SB\_THUMBPOSITION:
case SB\_THUMBTRACK:
nScrollPos = si.nTrackPos;
break;
case SB\_LEFT:
nScrollPos = nMin;
break;
case SB\_RIGHT:
nScrollPos = nMax;
break;
case SB\_LINELEFT:
nScrollPos = nCurPos - 2;
break;
case SB\_LINERIGHT:
nScrollPos = nCurPos + 2;
break;
case SB\_PAGELEFT:
nScrollPos = nCurPos - 5;
break;
case SB\_PAGERIGHT:
nScrollPos = nCurPos + 5;
break;
case SB\_ENDSCROLL:
nScrollPos = nCurPos;
break;
}
if(nScrollPos < nMin) nScrollPos = nMin;
else if(nScrollPos > nMax) nScrollPos = nMax;
pScrollBar->SetScrollPos( nScrollPos );
Invalidate();
CStatic::OnHScroll(nSBCode, nPos, pScrollBar);
}
After this a scroll bar appears with my control. But i can't change scroll position.
-kk.tvm-
Hi Friends I have created a class CImageViewer from CStatic. I also need scrolling of image in horizontal and vertical. I set scrollinfo for both scrolls and scrollbars (both) shown in my control. But it does not work. How can i solve this problem thanks in advance
-kk.tvm-
Hi Pete O'Hanlon Redefine ?
-kk.tvm-
hi friends i have a c++ dll which contains function and class. c++ dll code
class __declspec(dllexport) MyClass
{
public:
MyClass(void);
~MyClass(void);
void GetName()
{
.......
}
};
_declspec(dllexport) void MyFun()
{
}
My c# code follows
public partial class Form1 : Form
{
[DllImport("CPPDLL.dll", EntryPoint="MyFun")]
static extern void MyFun();
\[DllImport("CPPDLL.dll", EntryPoint="MyClass")\]
static class MyClass;
public Form1()
{
InitializeComponent();
}
}
but DllImport for class(MyClass) shows syntax error. how can i solve this problem thanks in advance
-kk.tvm-
Hi friends I have a c++ dll which contains a class named as CLog. How can i use above class in C# program thanks in advance
-kk.tvm-
Hi friends How to update a control value when an event occurs ? I have TextBox control in canvas. I coded to change value of TextBox when MouseEnter occurs. But it is not working. How to solve ? thanks in advance
-kk.tvm-
Hi what i mean is A program which will show in taskbar area NOT in system tray like Windows mediaplayer will show a small window in task bar area when minimized. thanks in advance kk
-kk.tvm-
Hi Friends How can i create a program that will run in windows taskbar region like Windows Mediaplayer minimized to task bar kk
-kk.tvm-
Hi bhiller I am trying to build a program which appears as system tray, that starts everytime when system starts. If i put program in user's starup folder, it will easily disable. thanks in advance
-kk.tvm-
Hi Friends An error "Access to the registry key 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run' is denied." occured in below code. How can i solve this problem
Registry.SetValue("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", "hello", "c:\\hello.exe");
thanks in advance
-kk.tvm-
Hi Connection string as follows m_strDBConnect = "ODBC;DRIVER={MICROSOFT ACCESS DRIVER (*.mdb)};DSN='';DBQ=c:\abc.mdb" thanks in advance
-kk.tvm-
Hi friends I am using CDatabase class to open Access database in my program. Sometimes it shows an error "Specified driver could not be loaded due to system error 1114 (MICROSOFT ACCESS DRIVER (*.mdb))". How can i resolve this problem thanks in advance
-kk.tvm-
Hi friends How to compact a database using CDatabase class or any other method in Visual C++ thanks in advance
-kk.tvm-
Hi I changed my code to above. But still message box displaying in chineese/jappaneese language string thanks in advance
-kk.tvm-
Hi friends I have a program which reads a file from web. That file contains unicode (UTF-8) chars. I used below code for my operation, but it shows junk chars while reading file, please suggest a solution to me.
CInternetSession InternetSession;
CStdioFile *httpFile;
CString str;
httpFile = InternetSession.OpenURL("www.mysite.com");
while( httpFile->ReadString( str ) )
{
AfxMessageBox( str );
}
thanks in advance
-kk.tvm-
Hi friends How to read news from a rss feed in c# thanks in advance
-kk.tvm-
Hi Friends How to create a program which will run in task bar like Windows Mediaplayer minimized to taskbar. kk
-kk.tvm-
Hi Friends Is any class or solution in VC to read rss feeds from net thanks in advance
-kk.tvm-