|
Ok, I got it, thanx., But why does the error have to occur when my application is not multithreaded after all?
|
|
|
|
|
disinterface is not getting created for my component. i dont find anything starting with a "_"(underscore)ISample" i mean _ISample. how to generate it? can we mannually add a disinterface? please help. time critical!
|
|
|
|
|
[i meant this. before i type this it got posted accidentally], now i'm not able to edit the above message. anyway where's my disinterface ??
V
|
|
|
|
|
Vivekuniq wrote:
where's my disinterface
you have to Select :- SUPPORT CONNECTION POINT check box for adding connection points i.e.Disinterface in your project/ATl lib
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Im creating a multi-tabbed application, in which i constantly update status fields on all the pages, the problem being when i start up, some of the pages arent initialized or something, cause i get an assertion failure on my getDlgItem, How do i go about initializing all those tabbed pages, other than code clicking each tab?? I'm new to VC++ and .net, and I've been digging for awhile and cant come to a logical conclusion on how to do this.
|
|
|
|
|
Im using the following code to create and setup my pages
CMyPage MyPage
...
MyPage.Construct(IDD_MYPAGE_PROPERTY_PAGE);
...
AddPage(&MyPage);
Stated in the MSN docs, is that for another to work, the tab needs to be selected first, is there a way to bypass this option? Or a different way to construct the page so that it doesnt need to be clicked on?
|
|
|
|
|
|
Wow, that was quite the post. It has more information in it than many articles. It just may be worth it to take that post, add a working example, and post it as an article.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
Thanks! Glad you liked. You know, making an article out of that post does sound like a good idea. I'll try to do it as soon as I finish a couple of things that are keeping me very busy these days.
Cheers,
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Its definitly on the right track, but my situation is a little more unique. Im constantly getting real time data from a socket, and is needed to post the data all over my GUI, I guess I could create all the objects from all the pages and store them, like in your example, but seems like a lot of work, cause then when a tab is clicked, i need to override the clicktab button or something so that it adds it to the queue to be constantly updated.
|
|
|
|
|
Or did i completly misunderstand what that article was telling me?
|
|
|
|
|
Hi,
If the Application thread (receiving thread) is one of the thread involved in a message deadlock, how do we solve this issue. MSDN says we should call ReplyMessage, (if InSendMessage() returns TRUE), in the WndProc of receiving thread, before calling any of the yeilding function calls like DialogBox, GetMessage, etc. But since one of the thread involved in the deadlock is the application thread itself, GetMessage would have been called before it reaches WndProc. Can anyone please help me?
Thanks in advance,
Ajay
|
|
|
|
|
Hi, i'm trying to make an aplication to blend subtitles onto a video stream. The renderer i need to use is the Video Mixing Renderer 9. The application is based on one of the examples of the DirectX SDK, called Text9. I'm using parto of the code. I've build the filter graph, with the VMR-9 as renderer. When i try to add the bitmap to the VMR's input, the program says: "Unhandled exception in executable.exe:0xc0000005:Access Violation".
This is the code:
HRESULT CText::BlendText(TCHAR *szNewText)
{
LONG cx, cy;
HRESULT hr;
CSubtitlesDlg dialog;
// Read the default video size
// hr = pWC->GetNativeVideoSize(&cx, &cy, NULL, NULL);
// Create a device context compatible with the current window
HDC hdc= GetDC(dialog.GetSafeHwnd());
HDC hdcBmp = CreateCompatibleDC(hdc);
// Write with a known font by selecting it into our HDC
HFONT hOldFont = (HFONT) SelectObject(hdcBmp, g_hFont);
// Determine the length of the string, then determine the
// dimensions (in pixels) of the character string using the
// currently selected font. These dimensions are used to create
// a bitmap below.
int nLength, nTextBmpWidth, nTextBmpHeight;
SIZE sz={0};
nLength = (int) _tcslen(szNewText);
GetTextExtentPoint32(hdcBmp, szNewText, nLength, &sz);
nTextBmpHeight = sz.cy;
nTextBmpWidth = sz.cx;
// Create a new bitmap that is compatible with the current window
HBITMAP hbm = CreateCompatibleBitmap(hdc, nTextBmpWidth, nTextBmpHeight);
ReleaseDC(dialog.GetSafeHwnd(), hdc);
// Select our bitmap into the device context and save the old one
BITMAP bm;
HBITMAP hbmOld;
GetObject(hbm, sizeof(bm), &bm);
hbmOld = (HBITMAP)SelectObject(hdcBmp, hbm);
// Set initial bitmap settings
RECT rcText;
SetRect(&rcText, 0, 0, nTextBmpWidth, nTextBmpHeight);
SetBkColor(hdcBmp, RGB(255, 255, 255)); // Pure white background
SetTextColor(hdcBmp, g_rgbColors); // Write text with requested color
// Draw the requested text string onto the bitmap
TextOut(hdcBmp, 0, 0, szNewText, nLength);
// Configure the VMR's bitmap structure
VMR9AlphaBitmap bmpInfo;
ZeroMemory(&bmpInfo, sizeof(bmpInfo));
bmpInfo.dwFlags = VMRBITMAP_HDC;
bmpInfo.hdc = hdcBmp; // DC which has selected our bitmap
// Remember the width of this new bitmap
g_nImageWidth = bm.bmWidth;
// Save the ratio of the bitmap's width to the width of the video file.
// This value is used to reposition the bitmap in composition space.
g_fBitmapCompWidth = (float)g_nImageWidth / (float)cx;
// Display the bitmap in the bottom right corner.
// rSrc specifies the source rectangle in the GDI device context
// rDest specifies the destination rectangle in composition space (0.0f to 1.0f)
bmpInfo.rDest.left = 0.0f + X_EDGE_BUFFER;
bmpInfo.rDest.right = 1.0f - X_EDGE_BUFFER;
bmpInfo.rDest.top = (float)(cy - bm.bmHeight) / (float)cy - Y_EDGE_BUFFER;
bmpInfo.rDest.bottom = 1.0f - Y_EDGE_BUFFER;
bmpInfo.rSrc = rcText;
// Transparency value 1.0 is opaque, 0.0 is transparent.
bmpInfo.fAlpha = TRANSPARENCY_VALUE;
// Set the COLORREF so that the bitmap outline will be transparent
// SetColorRef(bmpInfo);
// Give the bitmap to the VMR for display
CFilterGraph Graph;
hr = Graph.m_pBMP->SetAlphaBitmap(&bmpInfo); <----This is the point where i get the problem.
// Select the initial objects back into our device context
DeleteObject(SelectObject(hdcBmp, hbmOld));
SelectObject(hdc, hOldFont);
// Clean up resources
DeleteObject(hbm);
DeleteDC(hdcBmp);
return hr;
}
|
|
|
|
|
Hi
We have a large app that we are converting to WinXP from Win2000. We would like our toolbars and dialogs (check boxex, radio buttons, push buttons etc) to have the WinXP look and feel (called a theme maybe?).
How can this be achived ? I have added a call to InitCommonControlsEx() at the start of our GUI thread, but the buttons still look the old way.
Any ideas on an easy way to get the WinXP look and feel ?
Thanks
Tim Cox
|
|
|
|
|
mckavity wrote:
Any ideas on an easy way to get the WinXP look and feel ?
In the normal course of events, an application will automatically look like XP when run on that platform. Changing the code is not required. To verify this, create a small application using AppWizard and run it on both the Windows 2000 and Windows XP machines. They should both look correct.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
The apps do look exactly the same on both Win2K and WinXP. That is my problem. I would like them to look different. In other words, I would like the app when running on WinXP to have the WinXP look and feel. Like buttons showing emphasis when the mouse hovers over the etc. How does one get buttons that show this type of emphasis ? (ie the border changes color to indicate that the mouse is over the button and that the button can be clicked?
Tim
|
|
|
|
|
It seems you may be using VC6 instead of VS200x. If so, you can get the XP look by adding a manifest to your app enable visual styles. See this[^] article, specifically the section "To create a manifest and enable your application to use visual styles.".
Here's[^] a screenshot of an app I created using VC6, running on an XP box.
Hope this helps!
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
I'm using VS2003 (7.1.3088), so that's not my problem.
What I would like is that the buttons in my app to show a colored emphasis when the mouse moves over them, like all the apps do on WinXP. Right now, they show nothing, just like they did in Win2000.
Other apps do this. Example is IE. On Win2k, the buttons are regular, but on WinXP, the buttons show a yellow/orange emphasis when I move my mouse over them. This is what I want for my app too.
Am I making any sence ?
|
|
|
|
|
mckavity wrote:
I'm using VS2003 (7.1.3088), so that's not my problem.
You're right.
Contrary to what I said in my earlier post, I believe my suggestion applies to both VC6 and VC7.x generated apps. It worked for me and generated an app that displays XP-like controls on XP and non-XP-like controls on W2K.
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
mckavity wrote:
The apps do look exactly the same on both Win2K and WinXP. That is my problem. I would like them to look different.
I did not say they should look the same. I said they should look correct, meaning that it should look like Win2K on that machine (e.g., dialogs have four square corners, X button is gray), and it should look like WinXP on that machine (e.g., top corners of dialogs are round, X button is red, caption is taller).
Other than that, I'm not familiar with code that would cause their appearance to change (or stay the same).
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
|
hello. i am having a small problem. from code project only i have down loaded a code. that uses an object of CDatabase, the n calls its oopen function with microsoft excel driver. after thatn writing in to a excel file using .executesql(" insert into demo4 vales(.....)) function. like that. the result excel file is coming but at the beginning of each cell one ' is getting added to the data content( eg if adams is the data, 'adams is coming in excel , it is appearing as adams only but if u double click on the cell it is giving contents as 'adam. why is that so . is there any way to make it not come in the resultant excel files ? please tell me.
-- modified at 9:54 Monday 26th September, 2005
|
|
|
|
|
Show the code snippet that adds the values to the cells.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
sSql.Format("DRIVER={%s};DSN='';FIRSTROWHASNAMES=1;READONLY=FALSE;CREATE_DB=\"%s\";DBQ=%s", sDriver,gsExcelFileName,gsExcelFileName);
if( database.OpenEx(sSql,CDatabase::noOdbcDialog) )
{
//Create table structure
sSql = "Create Table MIDs ( ECMName TEXT,MID_Hex TEXT,MID_Dec TEXT,GroupBroadcast TEXT,ME_Number TEXT,AlarmLevel TEXT,SpecialWarning TEXT,AbuseType TEXT,ParameterName TEXT,Status TEXT,Instruction TEXT,MID TEXT,CID TEXT,DeleteCIDs TEXT,Display TEXT,Log TEXT,ServiceLamp TEXT,Telemetry TEXT,EventRecorder TEXT,ESET TEXT,Start TEXT,Actuate TEXT,Deactuate TEXT,Acknowledge TEXT,ServiceLight TEXT )";
//HistogramID number, HIstogramFormula TEXT)";
database.ExecuteSQL(sSql);
.
.
.
.
.
// The below is all sqlstatement how it is constructed. ValuesString.Format("'%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s'",ControlValueArray[44][1],MIDHexValue,ControlValueArray[43][1],ControlValueArray[2][1],ControlValueArray[3][1],AlaramLevel,ControlValueArray[38][1],ControlValueArray[39][1],ControlValueArray[44][1],ControlValueArray[41][1],ControlValueArray[42][1],ControlValueArray[43][1],ControlValueArray[4][1],DeleteCIDs,ControlValueArray[32][1],ControlValueArray[31][1],ControlValueArray[30][1],ControlValueArray[29][1],ControlValueArray[33][1],ControlValueArray[28][1],"N/A",ControlValueArray[15][1],ControlValueArray[16][1],ControlValueArray[17][1],ControlValueArray[18][1] );
sSql = "INSERT INTO MIDs(ECMName ,MID_Hex ,MID_Dec ,GroupBroadcast ,ME_Number ,AlarmLevel ,SpecialWarning ,AbuseType ,ParameterName ,Status ,Instruction ,MID ,CID ,DeleteCIDs ,Display ,Log ,ServiceLamp ,Telemetry ,EventRecorder ,ESET ,Start ,Actuate ,Deactuate ,Acknowledge ,ServiceLight ) VALUES ("+ ValuesString+ ")";
database.ExecuteSQL(sSql);
database.Close();
Like this it is adding to excel.
|
|
|
|
|
Did you look at how ValuesString is being constructed? The cause of your ' problem is right there?
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|