|
MFC is shipped with all versions EXCEPT express versions.
http://blog.joycode.com/jiangsheng
http://blog.csdn.net/jiangsheng
Command what is yours
Conquer what is not
---Kane
|
|
|
|
|
Hi,
Does anyone know how to prevent a view from being closed? I have a situation where I need a 'Master' view which is always open. It can be minimized/maximized but I need to prevent the user from closing it.
I am working in an MDI situation where there are other views which are written 'better' than others, therefore can be opened/closed without adverse effects on the document. However this legacy view currently needs to be locked until such time as I get time to re-write it.
If anyone can help I would really appreciate it.
Many thanks
Rob
|
|
|
|
|
Try the ON_WM_SYSCOMMAND message on the given child frame. And in the OnSysCommand function test:
UINT nItemID = (nID & 0xFFF0);<br />
if(nID == SC_CLOSE)<br />
{<br />
}
call the base class method.
I hope this help
Abyss
|
|
|
|
|
Thank you very much, this worked a treat.
Rob
|
|
|
|
|
Put a handler for WM_CLOSE in your MDI Frame class (not the view class, the frame class). In VC6.0 you can do this through ClassWizard, it will put the right member function prototype, messagemap macro and member definition in your project. If you don't want to close the MDI frame (and hence the view) just don't call the base class implementation of OnClose (usually CMDIChildWnd::OnClose()).
This will prevent the MDI frame/view from being closed, but you can still close the application (the mainframe wnd) as usual. If you want to avoid this, put a handler for WM_CLOSE in the mainframe class as well.
Cheers
Steen.
"To claim that computer games influence children is ridiculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
|
|
|
|
|
when we open the bitmap,bitmap will appear on the screen
and when we want to save the bitmap in different colour format like 24-bit,256-bit,16-bit,monochrome (not format like GPEG,GIF,TIFF etc) e.g. when we run MSPAINT and open one bitmap and save this bitmap as 256,24 etc.these option are avilable in MSPAINT.i want exact application to save the bitmap in different colour format(24,256 etc).
|
|
|
|
|
when we open the bitmap,bitmap will appear on the screen
and when we want to save the bitmap in different colour format like 24-bit,256-bit,16-bit,monochrome (not format like GPEG,GIF,TIFF etc) e.g. when we run MSPAINT and open one bitmap and save this bitmap as 256,24 etc.these option are avilable in MSPAINT.i want exact application to save the bitmap in different colour format(24,256 etc).
|
|
|
|
|
Hi,
Can anybody tell me how can I determine the inserted row ID (primary key)?
I inserted a new record to the database table but I don't know how to retrive what value was assigned to the primary key (ID). The ID is defined as automatic integer (Access database).
I insert the new record using the SQLExecDirect API method.
Thanks,
Abyss
|
|
|
|
|
SELECT @@IDENTITY
Cheers
Steen.
"To claim that computer games influence children is ridiculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
|
|
|
|
|
I'll try. I'm somehow a novice in database world. What '@' means? Also the IDENTITY will return the whole last record or just the ID?
Many thanks,
Abyss
|
|
|
|
|
@@ designates sql variables, at least in SQL Server (and to some extent Jet which is the native Access db). I guess you could say that it's internal SQL variables that you can gain access to this way. SELECT @@IDENTITY will return the last ID (not the record). You can write SELECT @@IDENTITY AS LastIdent if you want to name the return field.
Look up @@IDENTITY in MSDN, there's quite a number of @@ variables in SQL Server (@@ROWCOUNT and @@VERSION are nice too). That should give you an idea.
Cheers
Steen.
"To claim that computer games influence children is ridiculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
|
|
|
|
|
Hi,
Many thanks for help. I tried the following API calls immediately after insert. I use the same m_hStmn for the insert and the select query.
This call is successfull however when I query the returned value using the SQLFetch and SQLGetData the returned SQLINTEGER is always zero!?
SQLExecDirect(m_hStmn, (SQLTCHAR*)_T("SELECT @@IDENTITY AS 'Ident'"), SQL_NTS)
I tried to use the more save SCOPE_IDENTITY() function, however these API calls fail.
The driver returns (for Access table) undefined function.
SQLExecDirect(m_hStmn, (SQLTCHAR*)_T("SELECT SCOPE_IDENTITY()"), SQL_NTS)<br />
SQLExecDirect(m_hStmn, (SQLTCHAR*)_T("SELECT SCOPE_IDENTITY() As [Ident]"), SQL_NTS)
In this case I got from the driver one parameter missing error code:
SQLExecDirect(m_hStmn, (SQLTCHAR*)_T("SELECT SCOPE_IDENTITY"), SQL_NTS)
Can you explain how can I correctly get the inserted row's ID? Why the above calls fail ?
Thanks,
Abyss
|
|
|
|
|
Please anyone help me how to overwrite a string that is store in a file using vc++ source code?
|
|
|
|
|
here's the pseudocode:
1. Read file into string
2. Replace substring
3. Write new string to file.
Look on MSDN on CFile, FILE, CString, ...
Good luck.
No hurries, no worries.
|
|
|
|
|
Hi,
I'm using Visual Studio .NET 2003 since a while now, but there's something that really gets on my nerves from time to time. It's fact that the tabbed browsing can't be on several lines...
Using VS6 and WndTabs it was easy to change the settings to get it the way you wanted.
Does any body know a way to put the tabs of the documents on several lines instead of those ridiculous arrows to browse throught on a single line, or is there any other alternative to find the files quickly (plugin ?, btw the Window/Windows thing is not what I'm looking for ).
Thanks for any help,
- Pierre
|
|
|
|
|
hai i have one problem that i want to delete particular string from text file.for that what should i do?any body help me?
shan
|
|
|
|
|
|
can u give the code for remove string?pls.i will change for my need.
shan
|
|
|
|
|
|
shanweelmas@yahoo.co.uk
shan
|
|
|
|
|
|
Hello everybody!
I have a very annoying problem here.. the thing is, I am optimizing my
application with SSE `intrinsics' in some places, and the data used by
such instructions must be 16-byte aligned, or the program crashes.
So I have this class that contains the SSE data member, which
is aligned properly WITHIN the class. I have also overloaded the `new'
operator to properly handle a single object by allocating memory with
void * operator new( unsigned int cb ) {
void *res = _aligned_malloc( cb, 16 );
return res;
}
The problem comes with dynamic arrays; The compiler seems to add some _extra_
info before the actual array data, without aligning the array data properly after it.
I understand that the extra information is the array length or something like that.
Is there any other function I can override, that gets called _after_ operator new[] to
save such information myself - aligned?
Thanks anyone who helps me out..
I am having bad dreams about unaligned memory all the time.
/Erik
|
|
|
|
|
>> The compiler seems to add some _extra_
info before the actual array data
it adds the size of the array so that the 'operator delete[]()' *knows* how many objects it must delete.
Looks like you need to overload the 'operator delete[]()' so you can implement your own memory management system; and do not fogort to implement the corresponding 'operator delete()' and 'operator delete[]()'
Serge
|
|
|
|
|
Hello, and thanks for your reply!
I don't think it's the delete[] operator that is the problem right now.
I print the pointer that I obtain with _aligned_malloc to the screen (in
my overloaded operator new[]) and then print the pointer obtained by
_using_ the the new[] operator, the latter being unaligned and pointing
to my actual data... so something happens between the aligned allocation
in the overloaded new[] function and my assignment of the new pointer; e.g:
Pointer with _aligned_malloc = 0x00a40030 (aligned on 16-byte boundary).
Pointer after assigning the final object with new[] = 0x00a40034 (not aligned).
Even worse, the compiler seems to add extra extra info there in debug mode
- no simple workaround, such as adding and subtracting 4 bytes to the address.
So I need to be able to completely handle this on my own for my program to work...
hasn't anybody programmed with SSE instructions and come across this problem?
The delete[] operator will be a later problem, correct allocation is the most
important thing right now, so that the program doesn't crasch.
Thanks
|
|
|
|
|
I have an MFC dialog based application and the class associcated with the dialog is named CCoreDlg. In the dialog class I have a function named OnMessage( .... ) which I which like to be called from a plugin.
So, how do get to a this function ? From the main window handle?
What I am trying to accomplish is say:
1) Pass the main application window handle to each plugin
2) From a plugin call pMainApplicationWindow->OnMessage(...)
How would I accomplish this?
|
|
|
|