|
|
How can I communicate with the view through the main window class?
2 ideas: CFrameWnd::GetActiveView() and cast to your view class or keep a pointer to your view as a member of your frame class. Set it in OnCreate(...)
Now if only someone would answer my question. I did this for good karma
|
|
|
|
|
It works on NT 4.0, Win95 and Win98 but fails on a windows 2000 computer. I have Client for Microsoft Networks (with file sharing enabled), TCP/IP and NetBEUI network protocols installed.
Any ideas?
Cathy
|
|
|
|
|
Hi Cathy,
What does CFileException* pException tell you is wrong?
(Some good karma for me )
Neville Franks, Author of ED for Windows
www.getsoft.com
|
|
|
|
|
"An invalid file handle was associated with \\ComputerName\DirName\filename.ext"
This is the code:
serverfile.Open(csServerFileName, CFile::modeCreate |
CFile::modeWrite |
CFile::typeBinary, &e)
This works fine from other operating systems.
Cathy
|
|
|
|
|
My guess is that you're using a UNC and MSDOS doesn't know about such things.
Neville Franks, Author of ED for Windows
www.getsoft.com
|
|
|
|
|
I'm running on a win2000 machine trying to read a shared file on an MSDOS machine.
The same code runs without problems on 95, 98, ME and NT 4.0
|
|
|
|
|
Look at the actuall OS Error code being returned from the CFileException and see if you get find more detailed info about it. eg. Lookup MSDN for the extended error code in question.
It may be a security issue, but that's a wild stab in the dark.
Neville Franks, Author of ED for Windows
www.getsoft.com
|
|
|
|
|
It returns 66. I will look into it more on Monday.
Have a good weekend and thank you for your help.
Cathy
|
|
|
|
|
HOw do I make a drop down list multiple selection?
CComboBox has dropdown list but with single selection. Wheread if i use listbox with multiple selection, I do not get the dropdown feature.
Please help!!!
e-mail me at ananya@yahoo.com
|
|
|
|
|
I respond for here because i get this
Your message did not reach some or all of the intended recipients.
Subject:
Sent: 7/27/2001 4:36 PM
The following recipient(s) could not be reached:
'ananya@yahoo.com' on 7/27/2001 4:36 PM
Unable to deliver the message due to a communications failure
The MTS-ID of the original message is: c=US;a= ;p=Nixor Corp;l=NIXORMAIN-010727203609Z-35
Why a combobox multiselecction?
The combo box only show the selection, and is for this that you only can select a item.
Why you can't use the listbox?
Carlos Antollini.
|
|
|
|
|
I received the same email error messsage as the other poster, so I am going to apply here as well ...
While this is not the best solution, and by no means the only one, I believe Microsoft has an ActiveX (OCX) Multi-Select ComboBox control available. While this is obviously not going to be a native code solution to your issue, based on the sense of urgency in your message, I'm guessing this "fix" will do.
Check your local machine first for installed ActiveX components, if you don't see one there, you should be able to locate it on the Microsoft website.
At the very least, this will fix your issue until you can implement a native C++ solution in your code.
Good-Luck,
D.
|
|
|
|
|
Check out this article:
http://www.codeproject.com/combobox/checkcombo.asp
|
|
|
|
|
I have changed out the main framework icon IDR_MAINFRAME with a 32bit color icon that I'd like to use. When I run my application in debug mode, I received about 5 "User Break Point" error messages from the depths of the MFC yelling about "invalid heap pointers" and whatnot; yet my program runs.
Release mode, of course, it all works wonderfully.
Is there a AFX setting, project setting, or something else I can set, define or include that will suppress these "user break points"? Additionally, if you can provide me a little "in-sight" as to why this occurs along with your answer to my original question, it would be greatly appreciated (I'm sure others would like to know as well).
Thank you kindly,
D.
|
|
|
|
|
Is there a AFX setting, project setting, or something else I can set, define or include that will suppress these "user break points"?
This is only a side-effect of heap corruption caused by your app. You should use BoundsChecker or Purify to find out where things get screwed.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Tomasz:
I'd like to say this was indeed the problem, but I am unsure. To trouble shoot, I created an entirely NEW SDI project using the MFC Wizard. I imported my 32bit color icon, deleted the original MFC generated IDR_MAINFRAME icon from my resource file and named my new imported icon ID to IDR_MAINFRAME.
Clean. Rebuild all.
If I just "run" (!) the program it works, but when running in debug (F5) I get user breakpoints. The stack show I'm in NTDLL when I get a "heapblock modified" error message.
I've not written a single line of code at this point, I've only replaced the default 16 color icon with a true color icon.
D.
|
|
|
|
|
Hi,
I would like to create a function to calculate a checksum for a arraydata.
But I don't understand what I want for this checksum :
" lower 8 bits of the sum from data1 to data10 equals to zero".
My english is not perfect but I understand the sum of the data1 to data10 but equals to zero, I don't understand.
Best regards
youssef
|
|
|
|
|
|
Perhaps,
BYTE checksum = 0;
for ( int i = 0; i < 10; i++ )
{
checksum += (BYTE)( data[ i ] );
}
if ( checksum == 0 )
{
good checksum
}
else
{
bad checksum
}
This means that one of your array values is a checksum value which makes the whole array add up to zero.
PS: No one's English is perfect!
|
|
|
|
|
Hi there
I'm a Visual C++ newbie and i want to read and write bytes from a file @ specified offsets. Simply how do I do this?
I currently use the following code to do this bit of the programme, but it doesn't let me choose the offset of where I write to, only the value and number of bytes I patch! Please help!!!
==============================================
ofstream path("c:\\windows\\desktop\\debug.dat");
;
char *value_of_patch = "ffff";
int number_of_bytes = 10;
int setmode(int mode = filebuf::binary);
path.setmode(filebuf::binary);
path.write(value_of_patch, number_of_bytes);
================================================
Sample code is appreciated
Best regards,
Richard Edwards
|
|
|
|
|
I wrote this for Read get the number of page in a tiff file.
typedef struct _TiffHeader
{
WORD Identifier;
WORD Version;
DWORD IFDOffest;
}TIFHEADER;
typedef struct _TiffTag
{
WORD TagId;
WORD DataType;
DWORD DataCount;
DWORD DataOffset;
}TIFTAG;
long CWebBrowApp::GetTiffPageCount(LPCTSTR lpFileName)
{
TIFHEADER* udtTifHdr = new TIFHEADER;
WORD NumDirEntries;
DWORD NextIFDOffset;
long nPages = 0;
CFile tFile;
if(tFile.Open(lpFileName, CFile::modeRead | CFile::typeBinary))
{
tFile.Read(udtTifHdr, sizeof(TIFHEADER));
DWORD lOff = udtTifHdr->IFDOffest;
do
{
nPages++;
tFile.Seek(lOff, CFile::begin);
tFile.Read(&NumDirEntries, sizeof(WORD));
tFile.Seek(NumDirEntries * sizeof(TIFTAG), CFile::current);
tFile.Read(&NextIFDOffset, sizeof(DWORD));
lOff = NextIFDOffset;
}
while(NextIFDOffset != 0);
tFile.Close();
}
delete udtTifHdr;
return nPages;
}
I hope to help you!!!;)
Good Luck!!!
Carlos Antollini.
|
|
|
|
|
path.seekp(pos);
-c
------------------------------
Smaller Animals Software, Inc.
http://www.smalleranimals.com
|
|
|
|
|
Thanks for your help!
Sorry to ask again but how do I read INTEGER or LONG length values in from a binary file?
At the moment I can only get single bytes.
Do I use GET or READ?
How to I modify the following code to read an integer length value from address 4110 in the DAT file?
==============================================
ofstream path("c:\\windows\\desktop\\debug.dat");
........................
int pos = 4110;
path.seekg(pos);
int bytevalue = path.get();
================================================
Sorry to be dumb, tried to work it out myself but failed (& no online helpfile)
cheers
Richard Edwards
|
|
|
|
|
Does anyone know how to force CListView to select an entire row when you click on an item... by this I mean i insert a certain number of items each with 3 subitems... i want the item AND its subitems to appear highlighted...
Any help would be appreciated.
Joseph Dempsey
jdempsey@cox.rr.com
Joseph.Dempsey@thermobio.com
"Software Engineering is a race between the programmers, trying to make bigger and better fool-proof software, and the universe trying to make bigger fools. So far the Universe in winning."
--anonymous
|
|
|
|
|
Call the SetExtendedStyle function with LVS_EX_FULLROWSELECT as the parameter.
|
|
|
|