|
i keep getting this error,, how can I fix it?
I have the follwing function defined as public in the View class.
Void LoadBitmap (CString file);
and I get an error saying : missing storage-class or type specifiers
help me out
Ehsan Behboudi
|
|
|
|
|
Could it be that you've got to write void instead of Void ?
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
you are THE MAN,,,,
Ehsan Behboudi
|
|
|
|
|
Hi all,
I have a particular UI problem that I am seeking help with. I have a parent window that can be zoomed and scrolled. The parent window has a few child windows. When I scroll the parent window I have to recalculate the new position of the child windows and the I call ::MoveWindow on them. However, there is a slight jump in the child windows during scroll and the movement does not look fluid. Is there any way to eliminate this jumping behavior?
I tried the DeferWindowPos API and did not get any noticable improvement
Thanks for any help you might give me.
Pankaj
Without struggle, there is no progress
|
|
|
|
|
What I have done in the past is to hide the windows, move them, then show them. Only one flicker.
// hide windows
for (...)
{
pWnd->ShowWindow(SW_HIDE);
pWnd->MoveWindow(...);
}
for (...)
pWnd->ShowWindow(SW_SHOW);
|
|
|
|
|
Try modifying you OnEraseBkGnd as follows:
BOOL CSomeView::OnEraseBkgnd(CDC* pDC)
{
CRect clip;
static int dont_erase_indexes[] =
{
IDC_TITLE_PROMPT,
IDC_TITLE,
IDC_TRAY,
IDC_ASSAY
};
pDC->SaveDC();
for (int i = 0; i < sizeof(dont_erase_indexes[) / sizeof(int); i++)
{
CWnd *pWnd = GetDlgItem(dont_erase_indexes[[i]);
if (pWnd && pWnd->IsWindowVisible())
{
pWnd->GetWindowRect(&clip);
ScreenToClient(&clip);
pDC->ExcludeClipRect(&clip);
}
}
pDC->GetClipBox(&clip);
pDC->FillSolidRect(clip, GetSysColor(COLOR_BTNFACE));
pDC->RestoreDC(-1);
return FALSE;
}
I usually fins when a window is re-drawn this solves many flicker problems
Roger Allen
Sonork 100.10016
Were you different as a kid? Did you ever say "Ooohhh, shiny red" even once? - Paul Watson 11-February-2003
|
|
|
|
|
I am working on an MFC MDI project. I used internet explorer rebar as the toolbar option at the beginning of the project.
I added an edit box on the toolbar. Now, I want to get the text entered in this editbox but I could not find how I can do it.
Can anybody help me ?
Thanx...
|
|
|
|
|
Hi,
I used to program in VC++ 6.0 about two years ago, and I'm back in programming except I am using .net
Is there any change in functions and classes between them?
Ehsan Behboudi
|
|
|
|
|
Most of VC.NET is backwards compatible with VC 6.0.
However, they have tried to make it more standards-compliant. You will get warnings about some code that is non-standard and deprecated. For example, they deprecate the use of "old" IOStreams. So if you have code that does this:
#include <iostream.h>
...
cout << "Hey there!";
You will get a warning. You should replace it with the "new" IOStream headers:
#include <iostream>
...
std::cout << "Hey there!";
Also, it is possible (via the Preferences dialog) to force "for" loops to conform to the C++ standard (finally!), for example, you can get this standards-compliant code to compile (in VC 6 it would not):
for(int i = 0; i < somenum; i++)
...
for(int i = 0; i < someothernum; i++)
...
"When a man sits with a pretty girl for an hour, it seems like a minute. But let him sit on a hot stove for a minute and it's longer than any hour. That's relativity." - Albert Einstein
|
|
|
|
|
I have a program that creates some icons and start menu items. There have been problems in the past about the start menu and desktop not always refreshing, so to make sure everything refreshes properly, we have this code:
DWORD dwTmp;
SendMessageTimeout(HWND_BROADCAST, WM_PAINT, NULL, NULL, SMTO_BLOCK|SMTO_ABORTIFHUNG, 2000, &dwTmp);
Up until now, this has always worked. However, if the Find window in XP is open (you know, the one with the dog), Explorer crashes.
Any ideas? Is there a better way that I can ensure desktop and start menu items appear correctly in XP (I have no moral or ethical problems with doing something along the lines, if(XP) doThis(); else doItTheOldWay();
"When a man sits with a pretty girl for an hour, it seems like a minute. But let him sit on a hot stove for a minute and it's longer than any hour. That's relativity." - Albert Einstein
|
|
|
|
|
Well I'm not sure about the crash, but if I were you I'd try using SHChangeNotify to notify Explorer of changes. You can probably pass SHCNE_CREATE (to say you created some non-folder items) or SHCNE_UPDATEDIR (to say you changed the contents of a directory) for the flags. I've never tried it though, so I can't guarantee it will work.
Chris Richardson Terrain Software
|
|
|
|
|
I am new to this forum and am unsure how to go about this question. I use:
void CChildGraphFrame::OnPaint()
{
CPaintDC dc(this); // device context for painting
CDC* pDC = &dc;
Render(pDC); //paint structure
}
This procedure paints the image to the screen. What I don't understand is how to save this structure to a file. I also, don't understand if I have a DIB or DDB. If a resource (website, example, etc) can be given to me or atleast a good starting point.
Thank you for your time,
Jim D
|
|
|
|
|
If, after painting, you want the contents of the region that was painted, you could call CDC::GetCurrentBitmap(). This returns the current DC bitmap object. You can then do whatever you wish with the BMP.
|
|
|
|
|
1. Create a memory DC
2. Create a bitmap object and select it into the DC
3. Draw onto the memory DC
4. Save the bitmap to file. You probably need to convert it to DIB for this to work.
There are articles at www.codeguru.com[^] www.codeguru.com written by Zafir Anjum that should help you somewhat.
Hope this helps.
Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!
|
|
|
|
|
|
RasEnumEntries() is what you need.
|
|
|
|
|
Thank you for your reply, but my DSN=Data Source Names,
EnumDataSourceNames() is what my need, but i don't know how to use it!
|
|
|
|
|
Here is a snippet of code that fills a combo box with the currently configured DSNs. Hope it helps....
void AppDB::LoadDSNComboBox()
{
CComboBox *pCB = (CComboBox *)GetDlgItem(IDC_APPDB_DSN);
CString cSelection;
GetDlgItemText(IDC_APPDB_DSN,cSelection);
pCB->ResetContent();
SQLHENV hEnv;
SQLAllocEnv(&hEnv);
char caFmt[512];
char caServerName[256];
char caDesc[256];
SQLSMALLINT iNameLen, iDescLen;
SQLRETURN iRetval = SQLDataSources(hEnv,SQL_FETCH_FIRST_SYSTEM,
(unsigned char *)caServerName,
sizeof(caServerName)-1,
&iNameLen,
(unsigned char *)caDesc,
sizeof(caDesc)-1,
&iDescLen);
while (iRetval == SQL_SUCCESS || iRetval == SQL_SUCCESS_WITH_INFO)
{
caServerName[iNameLen] = 0;
caDesc[iDescLen] = 0;
if (iDescLen > 0)
{
sprintf(caFmt,"%s [%s]",caServerName,caDesc);
pCB->AddString(caFmt);
}
else
pCB->AddString(caServerName);
iRetval = SQLDataSources(hEnv,SQL_FETCH_NEXT,
(unsigned char *)caServerName,
sizeof(caServerName)-1,
&iNameLen,
(unsigned char *)caDesc,
sizeof(caDesc)-1,
&iDescLen);
}
SQLFreeEnv(hEnv);
}
|
|
|
|
|
BTW, the flags in this example only return SYSTEM DSNs.
|
|
|
|
|
|
My bad, in a big way. Once I saw your question, I immediately put on my RAS hat. I'm glad you found the answer in spite of my faux pas.
|
|
|
|
|
Help!
I am having a problem initializing the common controls using
InitCommonControlsEx(), specifically that when I call it I am
getting Error 2 (The system cannot find the file specified.).
This is a wind32 SDK application. Other than this control,
it works. The only (potentially) pathological thing I'm trying
to do is make this control (ListBox) a child of the main
application window, but the program isn't even getting to that
point.
I am using VS.NET 2002 with the latest (Feb 03) Platform SDK.
According to depend.exe, the comctl32.dll that my program is
using is located in C:\windows\system32 and has the following
properties:
File Version: 5.82.2800.1106
Product Version: 6.0.2800.1106
Image Version: 5.1
ALSO, comctl32.lib is included in my "Link/Input/Additional Depndencies"
settings for the project. I have my global settings for VC.NET
set so that the SDK paths are searched first for lib and
include files.
Here is a code snippet illustrating the problem:
#include "main.h"<br />
#include "WindowFinder.h"<br />
#include "resource.h"<br />
#include <tchar.h><br />
#include <stdio.h><br />
#include <CommCtrl.h><br />
<br />
....<br />
<br />
BOOL InitializeApplication(HINSTANCE hThisInst, <br />
HINSTANCE hPrevInst, <br />
LPTSTR lpszArgs, <br />
int nWinMode )<br />
{ <br />
...<br />
...<br />
... <br />
(initialize wc)<br />
...<br />
if (!RegisterClass(&wc)) <br />
{<br />
return FALSE; <br />
}<br />
INITCOMMONCONTROLSEX icrtl;<br />
icrtl.dwSize = sizeof(INITCOMMONCONTROLSEX);<br />
icrtl.dwICC = ICC_LISTVIEW_CLASSES <br />
| ICC_STANDARD_CLASSES <br />
| ICC_TREEVIEW_CLASSES;<br />
<br />
if ( !InitCommonControlsEx( &icrtl ) )<br />
{<br />
DWORD err = GetLastError();<br />
return FALSE; <br />
}<br />
...<br />
}
Dr. Walter Tackett
Alden Management LP
e m a i l : walter underscore tackett at msn dot com
|
|
|
|
|
I answeed my own question. The problem is the line
| ICC_STANDARD_CLASSES
Despite what the doc says, leaving this flag out makes everything work. Also, the "standard classes" (i.e., the controls loaded by the old InitCommonControls(void) ) are loaded automatically despite not indluding this flag.
WAT
Dr. Walter Tackett
Alden Management LP
e m a i l : walter underscore tackett at msn dot com
|
|
|
|
|
How to change a font on a button using windows API?
Please help
|
|
|
|
|
1) create a font (see CFont)
2) pBtn->SetFont(&oNewFont);
|
|
|
|
|