|
My app needs access to a drive on another system on my network - however, the system may not be powered on and therefore a permanent system mapping will be a problem at boot-up time. How can I set up a network mapping programmatically when my app starts (and premsumably drop that mapping when the app closes) ? Many thanks for help !
Doug
|
|
|
|
|
Try NetUseAdd() or WNetAddConnection2() .
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
I would like to attempt to do some X-Y graphing without using MFC. I want to use generic C++ and some graphics libraries and put together a console application. Are there any free graphics libraries? If so, can you do use any simple controls with them?
Jerry
|
|
|
|
|
|
|
Hi guys,
Can any one help me on this. I have a VB DLL and i need to call it in one of C code in VC++. can any one provide me a sample code or suggest me how to do.
Cheers
Tuscan.
|
|
|
|
|
Tuscan wrote:
I have a VB DLL and i need to call it...
Use LoadLibrary() for this.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Presumably this is an 'ActiveX DLL'. Look at the documentation for the #import statement.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Hi All,
I have a problem.
I have written a Hook Dll. I want to pass a handle from my dll to the application which sets the hook.
So I think I have to use Shared data using
#pragma comment(linker, "/SECTION:.A2IDATA,RWS")
#pragma data_seg (".A2IDATA")
HWND hDlgWnd = NULL;
#pragma data_seg()
Thus I have defined shared section in my dll. But how do I use this shared dta in my application. if write directly
HWND hWnd = hDlgWnd // This give me compile time error saying hDlgWnd not defined..
so how do i access this shared hDlgWnd memory..?
I would appreciate your answer in this regard?
--------------
Vaibhav...
|
|
|
|
|
The data segment of the DLL is not 'visible' to the EXE, even though it is SHARED among all the EXE that have the DLL loaded.
There might be other solutions, but this one is fairly easy and safe to do:
Write a function to return the value of hDlgWnd.
Export the function from the DLL.
Call the function from the EXE instead of trying to access the variable directly from within the EXE.
|
|
|
|
|
Thanks for the answere.
--------------
Vaibhav...
|
|
|
|
|
Hi!
I'm trying to write a small program that analyzes the text in a normal text file.
I'm using the C++ ifstream methods.
My question is:
char *buf;
buf = new char;
ifstream file("test.txt");
...
file.getline(buf, 100);
When I do this buf will contain a row of text.
How do I do to know the size of buf??
I've tried sizeof(buf) but I get = 4
Debugging the code I see that buf has more then 4 character...counting them I get to 77.
Any good tips!
Thanks!
|
|
|
|
|
strlen() function gives the length of a C string, when Sizeof returns the size in bytes of the variable passed as its parameter...
when you write
char *buf;
sizeof(buf);
it will always return 4 because on 32-bits architecture, pointers are 32 bits long, ie. 4 bytes...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
char buf[100];
ifstream file("test.txt");
...
file.getline(buf, 100);
you should do this
I love Programming
|
|
|
|
|
|
Hello,
You can retrieve the extraction count. This is the amount of characters read from the last call to an unformatted input function. Look here[^] and here[^] for more information on gcount() and basic_istream respectively.
int nCount = file.gcount();
Hope this helps.
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Hachaso wrote:
file.getline(buf, 100);
If you are going to be asking for 100 bytes from the file, the buffer needs to be large enough. As it stands you are only allocating room for 1. Change the allocation to:
buf = new char[100]; Don't forget to delete it when done!
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
I am not able to read plain 8-bit text files (like the one created by Notepad) under windows CE, because this OS natively uses 2-byte Unicode characters: it reads one character every two bytes... For example, the text "ciao" may become 2 chinese symbols.
I'm using the MFC, and CFile::Read(), CArchive::ReadString() ... all don't work. How can i tell him to treat text files as 1-byte ASCII files?
Or maybe i can convert the strings to 8-bit AFTER reading them, but this way i couldn't use ReadString; it wouldn't find the ASCII LineFeed while reading.
Thanks
|
|
|
|
|
Make sure _UNICODE (and UNICODE) is not defined when compiling your code. If for some strange reason that does not work, either use wide-characters (UNICODE) or use one of the functions for converting wide-characters to ASCII.
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
In windows CE, unicode is normality, it isn't defined...
You mean functions like wcstombs()? This is not the case, they convert for example L"Hello" to "Hello", while i'd have to phisically split every couple of bytes
|
|
|
|
|
How can i create/open a word doc and add data based on a template. Pls hlp.....
|
|
|
|
|
Hi there,
Search the MSDN for
automation MFC Word HOWTO
you'll get a bunch of old but good articles about Word automation
~RaGE();
|
|
|
|
|
hiho@ll
i want to add a static control to a toolbar for a news ticker
this means a static control in a toolbar with changing text
i already thought of a button without an image, but if i don't use an image i have a little rect left of the text where the image should be
the second problem will be, how to change the text randomly? (in both situations, button or static control)
thx@ll
|
|
|
|
|
Hi!
I'm developing an application using MFC.In the application I've some static controls and some created at runtime.
When the application starts,I want to set the focus to the editbox(created at runtime).
I've used SetFocus and SetTabIndex for this but everytime the focus is being set to the first control created statically.
Kindly help me with this.
Thanks
|
|
|
|
|
This is not an MFC problem. If you set the focus to anything other than the default, then your dialaog init function must return FALSE: otherwise the system will set it to the default keyboard focus.
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|