0

hi
Is there any function in vc++ do the same thing as the Input (int,int)
function in vb?
and is there one ... would someone please tell me what is it?
thanks in advance
lahom

2
Contributors
6
Replies
7
Views
8 Years
Discussion Span
Last Post by lahom
0

excuse me ...but nothing shows when i pass or even press the "this function"
so i dont know the function u r talking about

0

yes
thats what i was talking about
put i dont know how to replace this function in vb to vc++:

Public Function GetFile(Filename As String)
    Dim path As String
    Dim Fnum As Integer

    '---read file in one pass!
    Fnum = FreeFile
    Open Filename For Input As #Fnum
        GetFile = Input(LOF(Fnum), Fnum)
    Close Fnum

    Exit Function
    
ErrorHandler:
    Err.Description = "GetFile: " & Err.Description & " -> " & File
    Err.Raise Err.Number


End Function

would u please tell me how?
thank u

0

Read the tutorial I posted and you will understand. It's a lot more complicated than VB. If you are going to write a c++ program then you absolutely must understand file i/o. Forget what you nearned from VB, C++ is completly different.

0

no ...its not like that at all
i found a tutorial to create ur own file type association in VB
(it was so hard to find in vc++)
and i converted with aprogram called(VBto converter) to vc++ code.
but i needed to modify some functions .... and one of them was (Input) and it is as i hope the last one....
i tried to reproduce the function body in vb into vc++

CComVariant Input(int numchars, int filenum)
{
	return Input_d(numchars, filenum);
}

CString Input_d(int numchars, int filenum)
{
	return "";					
}

but it does make link problem not when compiling BUT when running saying that
Linking...
Form1.obj : error LNK2001: unresolved external symbol "protected: class ATL::CComVariant __thiscall CForm1::Input(int,int)" (?Input@CForm1@@IAE?AVCComVariant@ATL@@HH@Z)
Debug/File_Associate.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
//*******************************************************//
i hope u get what i mean
any thing u can do to help me?
thanks

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.