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

Recommended Answers

All 6 Replies

Do you mean this function ?

Not exactly -- use ifstream declared in <fstream> file and its >> operator or getline() function to read data into a variable.

Here is one of many tutorials you can find on the net

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

You are absolutely right -- here is a good link, I hope

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

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.

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.