|
My company recently switched over from Vis 6.0 (thank the holy of holies..), but there is an odd corruption which occurs when a change occurs to the resources in the project. Multiple errors occur such as "STRINGTABLE not found" and other identifier-missing-type errors when compiling the newly changed .RC . Of particularly interesting note - in the current .RC file there exists an .MDB file, which if taken out of project prior to changing a resource, and compiling, will not cause such errors. I have NO IDEA what dependency might be linked to that - its pretty crazy... If anyone has a CLUE as to what I can do to keep this from happening, I would give my first child at this point...
-- Lost And Lonely in Resource Land
|
|
|
|
|
I have an application MS Visual Studio.Net, written in C++. I want to monitor memory as I allocate and deallocate memory. How can I do this?
Thanks.
Jerry
|
|
|
|
|
Override new and delete operators
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
How to not ower-paint others child windows in CDialog?
One CStatic child window is owner Drawn,
and paints self in OnPaint() handler.
But it always paints self over others child windows,
is there method to paint it under other child windows?
Tab-order not works?
Thanks
|
|
|
|
|
Tha
vgrigor wrote:
But it always paints self over others child windows,
that is because the static control is over the other window.
I dont know what you are trying to do, but putting two controls over each other is not the right way to design any UI.
If you want to push the static control behind the other contorl then change the tab order of the control.
|
|
|
|
|
Design goal may different,
and not all you may understand before known,
to reject.
I made tab-oreder first for CStatic,
but it again stays on the top.
|
|
|
|
|
First of all you are in a problem and you dont know how to use the dialog editor to place the item on the screen properly and plus you have this attitude.
I did not reject ur design, All i said is the design is not proper and therefore not efficient and now you know why.
|
|
|
|
|
|
Why my editor doesn't paste newlines from clipboard when I copy from IE?And why a CEdit control pastes the newlines?
Thank you.
|
|
|
|
|
You want to look at your editor for the problem. I quickly fired up notepad, and it handled the
newlines when pasting from IE. Similarly, VC++6 handles them fine too.
If you've written your own editor, look at the code which handles the pasting. It may be that
IE just gives newlines, and you are expecting CR-LF (Carriage return / Line feed, or \r\n) pairs.
Iain.
|
|
|
|
|
My apologies. I didn't read your subject line.
I added a rich text control to a dialog, and experienced the same problem as you.
You need to set the ES_MULTILINE style. Either manually, or by ticking the
"Multi Line" option on the Styles property page for the control.
Iain.
|
|
|
|
|
Hi all,
Explanation :
1. I add a new record to an Access table;
CMyTable test;
test.Open();
test.AddNew();
...
test.Update();
test.Close();
2. then, I want to fill a ListCtrl with ALL the record from this table
--> problem, the new record isn't present !
if I wait a little with a loop :
for(long i=0; i<1000000; i++); )
then the new record is here.
Is there another thing better ?
How can I do to be sure that the new Recordset will contain the new record ?
|
|
|
|
|
Without seeing the actual code, it's very hard to tell. Assuming your code is correct, it sounds like it might be a caching problem. Use
CDatabase db;
CMyTable test(&db);
TRY
{
test.Open();
test.AddNew();
...
if (test.Update() != FALSE)
{
test.Requery();
test.MoveFirst();
while (! test.IsEOF())
test.MoveNext();
}
}
CATCH(CDBException, pDBException)
{
AfxMessageBox(pDBException->m_strError);
}
END_CATCH
test.Close(); to see if any DB exceptions are lying in wait.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
I do something like this, but there is no CException generated; it's just that the last Record isn't in the Recordset when I re-open it.
CMyRecordset MyRecord;
try
{
MyRecord.Open();
MyRecord.AddNew();
...
MyRecord.Close();
// then I call a function to fill a ListCtrl with all the data from the table
MyRecord.Open();
while(MyRecord.IsEOF() == FALSE)
{
MyListCtrl.Add();
MyRecord.MoveNext();
}
MyRecord.Close();
}
catch(CException *e)
{
...
}
--> I have to do a loop before I re-open the Recordset in the FillListCtrl() function otherwise the new Record isn't in the Recordset !
???
BrutalDeath0
|
|
|
|
|
Set a breakpoint on the MyRecord.Open() statement. Then open the .mdb file and see if the record has been added. Otherwise, see if either of these MSDN articles help:
Q153491
Q153046
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
hi,
I've been working on a project with two documents types (one controlling a pair of cameras & their capture, one for DIBs). Implementation of the first document type (cameras) seemed to go smoothly, with its own;
- menu
- icon
- string table entry
- CDocument derived class
- CView derived class
- CMDIChildWnd derived class
This class also handles one message from a button on the toolbar. I've also set-up all aspects of the second document type (apart from it uses a standard ChildWnd at the mo) but as soon as I add it to the document template neither document type will start up. i.e. I'm not presented with an dialog option for which document type I want to start with. Has anyone got any ideas why this might be?? does it sound like I've put in dodgy string table entries or is it likely to be something else??
Cheers for any help
Dave
|
|
|
|
|
Dont worry about answering this post. I've found that the quickest & simplest way to fix the problem in my case was to just start again and re-import all the classes I've created. I'm gonna put it down to me messing with the string table entries and 'resource.h' but if I find a more specific reason will post it here.
|
|
|
|
|
I have the following code, which causes a problem on some mashines where I tried to install and run the program which uses it:
CColorDialog dlg;
COLORREF selectedColor;
if (dlg.DoModal() == IDOK) {
selectedColor = dlg.GetColor();
//..
}
//..
Now, the problem occours while the ColorDialog is modaly opened. On some installations it will cause various part pallets and error messages relating to a "missing resource", at which point the system tends to lock up and Ctrl/alt/del is the only way out.
I do use the MFC Library in a shared DLL. My first guess was that it may be because of that, but I do not think so now.
I do not know which step to go next!?
Thanks for any help!
Miki
|
|
|
|
|
The code works fine on Windows 2000 and Windows XP, but causes this problems on Windows 98 and ME.. hm..
|
|
|
|
|
The following code always fails
// get service information
int nSel = m_ctlListServices.GetSelectionMark();
if(nSel == -1)
{
return;
}
else
{
TCHAR szService[BUFF_LEN];
// get the text of second column
m_ctlListServices.GetItemText(nSel, 1, szService, BUFF_LEN);
SC_HANDLE hSCM = OpenSCManager(m_strPCName, NULL, SC_MANAGER_ALL_ACCESS);
SC_HANDLE hService = OpenService(hSCM, szService, SERVICE_ALL_ACCESS);
// stop service
if(ControlService(hService,SERVICE_CONTROL_STOP,NULL)==0)
{
m_strMessage.LoadString(IDS_SERVICE_STOP_ERROR);
m_strTitle.LoadString(IDS_ERROR);
MessageBox(m_strMessage, m_strTitle, MB_OK|MB_ICONERROR);
}
// refresh
OnBrefresh();
CloseServiceHandle(hService);
CloseServiceHandle(hSCM);
}
The service can accept stop, the program is running on administrator account, I just don't have idea why the stop function is failing
Help!
|
|
|
|
|
First of all, you should be calling GetLastError to figure out why the call to ControlService fails (note that it is important to call GetLastErorr *immediately* after the ControlService call):
if(ControlService(hService,SERVICE_CONTROL_STOP,NULL)==0)
{
DWORD error = ::GetLastError();
...
}
Then either step through with a debugger, or output the error code in the message box, and see what it is. You can look it up in Visual Studio (there is an "Error lookup" in the "Tools" menu) and get more info.
Remember, even if you win the rat race, you're still a rat.
|
|
|
|
|
Thanks for the reply,
the error that I get for every attempt to close any service is "Attempt to access invalid address". What am I doing wrong?
Thanks!
|
|
|
|
|
Good question - maybe your handle is invalid?? You can use the GetLastError trick on *all* the calls, including the ones to open the service. Maybe it's something as simple as not passing in the right service name.
Remember, even if you win the rat race, you're still a rat.
|
|
|
|
|
The following code always fails
// get service information
int nSel = m_ctlListServices.GetSelectionMark();
if(nSel == -1)
{
return;
}
else
{
TCHAR szService[BUFF_LEN];
// get the text of second column
m_ctlListServices.GetItemText(nSel, 1, szService, BUFF_LEN);
SC_HANDLE hSCM = OpenSCManager(m_strPCName, NULL, SC_MANAGER_ALL_ACCESS);
SC_HANDLE hService = OpenService(hSCM, szService, SERVICE_ALL_ACCESS);
// stop service
if(ControlService(hService,SERVICE_CONTROL_STOP,NULL)==0)
{
m_strMessage.LoadString(IDS_SERVICE_STOP_ERROR);
m_strTitle.LoadString(IDS_ERROR);
MessageBox(m_strMessage, m_strTitle, MB_OK|MB_ICONERROR);
}
// refresh
OnBrefresh();
CloseServiceHandle(hService);
CloseServiceHandle(hSCM);
}
The service can accept stop, the program is running on administrator account, I just don't have idea why the stop function is failing :
|
|
|
|
|
Hi, I am trying to write/read a large double matrix (vector of vectors) to file as fast as possible.
My first attempt uses STL ofstream_iterator, vector, and copy() and takes approx 95 seconds to write a 140Mb CSV file. This is 1,900 rows and 10,000 columns.
I need to reduce this time substantially, as the matrix could be as many as 40,000 columns.
I want to use Win32 API WriteFile() and ReadFile() to write/read the raw BYTE representation of my double matrix, but I am unsure how to go about it.
Could someone who knows point me in the right direction, or suggest a better alternative to this approach?
Thanks,
Christopher
The bomb lives only as it is falling
|
|
|
|