|
Daniel Kanev wrote: I want to log on to another computer using netbios.
Are you referring to Netbios() ?
Do you have to log into the machine prior to copying the file? If not, check out CopyFile() and SHFileOperation() .
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Yes, I refer to NetBios(). How can I use this function to log on and perform file operations?
modified 8-Mar-17 3:52am.
|
|
|
|
|
Unless there's something you can do in the NCB structure, I don't know of a way.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi,
and maybe this way:
WNetAddConnection2( LPNETRESOURCE lpNetResource, LPCTSTR lpPassword, LPCTSTR lpUsername, DWORD dwFlags );
BOOL CopyFile( LPCTSTR lpExistingFileName, LPCTSTR lpNewFileName, BOOL bFailIfExists );
or
int SHFileOperation( LPSHFILEOPSTRUCT lpFileOp );
DWORD WNetCancelConnection2( LPCTSTR lpName, DWORD dwFlags, BOOL fForce );
-----------
Mila
|
|
|
|
|
I want to change toolbar bmp's default transparent color (192,192,192) to other color in MFC.
Anyone who can tell me, Thanks a lot.
|
|
|
|
|
my code:
<br />
BYTE * pBuf = (BYTE *)new char [1024];<br />
<br />
CMemFile* p_mF = new CMemFile( pBuf, 1024, 1024);<br />
<br />
cout << p_mF->GetFilePath() << endl;
<br />
p_mF->SetFilePath("D:\\1.txt");
<br />
<br />
CFile myfile("D:\\1.txt",CFile::modeRead);
<br />
|
|
|
|
|
Try:
CFile myfile("D:\\1.txt", CFile::modeRead);
DWORD dwLength = myfile.GetLength();
LPBYTE pBuf = new BYTE[dwLength];
myfile.Read(pBuf, dwLength);
myfile.Close();
CMemFile mF;
mF.Attach(pBuf, dwLength);
...
mF.Close();
delete [] pBuf;
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
when project running at
CFile myfile("D:\\1.txt", CFile::modeRead);
is error, because D:\1.txt not exist.
|
|
|
|
|
Ok, and? It's common knowledge that a file that does not exist cannot be read from. This is not a code problem.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
How to create transparent gif file?
|
|
|
|
|
you mean, programmatically ?
use the CxImage[^] library
|
|
|
|
|
Hi everyone,
In programs like powerpoint or AcdSee we can see many Transitions but how can I make these states is it possible with VC++.
Thanks
|
|
|
|
|
By Transitions I presume you mean a slide show like effect? This[^] may help you.
|
|
|
|
|
I am writing the interface in C++ and someone else will write the implementation.
Some interfaces have to have only one son that should be singleton, that is the object of the only son of my interface should be only one in the whole system.
I am using templates to obligate some son class of my interface class to be singleton, but how can I obligate that it will be only one son class of my interface class? (That the implementer will not be able to inherit from my interface class more than once)
Is it possible?
Thanks in advance.
|
|
|
|
|
Make the constructor in your interface private, declare the implementation class as a friend to your interface, and use "public virtual" inheritance of your interface from the implementation class - that'll prevent any other class inheriting, as it won't be able to see the constructor.
See here:
http://www.research.att.com/~bs/bs_faq2.html#no-derivation[^]
The only problem is that the person doing the implementation would be free to change
class Usable : public virtual Usable_lock {
to
class Usable : public Usable_lock {
which would allow somebody to derive from Usable
If you've got control of setting up the instantiation of Usable, then all should be fine, but in the end of the day, there'll always be loopholes if the person doing the development is determined to do things they shouldn't (That's what code reviews are for!)
|
|
|
|
|
Hello Mr. benjymous,
Thanks for the answer!
But in my case the interface class is placed in the H file and the implementation class is placed in the DLL, the DLL #include H with the interfaces, but H with the interface does not know "who" is the implementation class.
The interface is really independant and does not aware about classes that are implementing it.
So the solution you proposed is not really good for my case.
Is it possible in my case?
Thanks a lot in advance.
|
|
|
|
|
Hi.
I was wondering if MFC supplies a MessageBox kind of thing where the output can be formatted. Some thing like the good old printf:
printf("Hello! Your are customer number %d \n", CustomerNumber);
That would make it possible for me to output my variables to messagebox. Any other way is also cool, except the one with having to write my own custom window.
Abhishek
It is impossible to change your past. But it is very possible to ruin your present by worring about the future.
-Chankya
|
|
|
|
|
Use CString and the Format() method:
CString str;
str.Format(_T("Hello! You are customer number: %d"), CustomerNumber);
AfxMessageBox(str);
|
|
|
|
|
Thanks a lot Mike.
Abhishek
It is impossible to change your past. But it is very possible to ruin your present by worring about the future.
-Chankya
|
|
|
|
|
In addition to Michael's suggestion, there's also AfxFormatString1() .
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I would use the TRACE macro to output variable in the output window in the DEBUG mode, instead of using message box.
|
|
|
|
|
Hello
I have created a map which looks :
typedef map <char *,="" int,="" ltstr=""> MapData;
where ltstr is the comparator I use.
struct ltstr
{
bool operator()(const char* s1, const char* s2) const
{
return strcmp(s1, s2) < 0;
}
};
I want to use the function equal_range in algorithm class.
and to use my comparator, but I don't know how define the comparator for this function.
Does anyone know ?
Thanks,
Clint
|
|
|
|
|
Hi,
I have a wmv file. Now I want to add a application specific data into wmv file. Is this possible and allowed? How can I achive this?
Regards,
Hemant.
|
|
|
|
|
|
Hi,
Thanks for your reply. I am using Windows media format SDK. Can you just give some details(It will be great if you can post some code ) about how can I achive this.
Regards,
Hemant.
|
|
|
|