|
This is the correct way:
<br> CEdit* edit = (CEdit*)win->GetDlgItem( RESOURCE_ID ); <br>
It's very strange that the compiler didn't said anything about this!
------------------------------
©0d3 ©®4©k3® - That's me!
------------------------------
|
|
|
|
|
Hi
I thing you got me wrong.
My question is not about the syntax of
the code I attached to the message.
My question is about the way to get the CEdit control
I got the RESOUCE_ID using the Spy++ utility
|
|
|
|
|
Let's say that you have an edit on a dialog in another app with ID 1245.
First we have to find the window that the edit is on:
CWnd* hWnd = FindWindow(classname, NULL); // Or try find the window by using the title
then we have to get the edit control:
CEdit* edit = (CEdit*)hWnd->GetDLgItem(1245);
set the text "Hello" in the edit box:
edit->SetWindowText("Hello");
If it still retur NULL it perhaps can be a view the edit is putted on. I don't think this would work then.
Then you have to find the window (view) and the find the edit in that window (view).
Wasn't this right?
------------------------------
©0d3 ©®4©k3® - That's me!
------------------------------
|
|
|
|
|
I am trying to implement a hex editor. I need a strategy to keep track of the modifications a user might be making in an open file.I thought of allocating a buffer of the size of the file , but this only works for small files.For large files this is highly inefficient.
Any suggestions as to how this can be done efficiently?
vimal
|
|
|
|
|
can you not keep track of the new data, the old data and a file offset and length?
---
"every year we invent better idiot proof systems and every year they invent better idiots ... and the linux zealots still aren't being sterilized"
|
|
|
|
|
I Want Changing a Cursor Icon In Visual c++ ?
thanks for your help
|
|
|
|
|
SetCursor()
------------------------------
©0d3 ©®4©k3® - That's me!
------------------------------
|
|
|
|
|
--------------------------------------------------------------------------------
Can anybody upload or send me (fayegolf@hotmail.com) full working example,
which will create shortcut of DUN entry(.lnk) to it on the desktop.
Thank you!
|
|
|
|
|
|
Does anybody know how to eather insert a button into a RichEditCtrl or get the curser position on the RichEditCtrl?
cheers
Dor
|
|
|
|
|
Hi all,
I added a custom button to Outlook Express toolbar using Windows Hook.
However, my new button keeps showing up 'grayed' eventhough I set it's
state to 'TBSTATE_ENABLED'
before I inseted it to the toolbar. If you know how to set this button to
"enabled" state, please
enlight me with your knowledge. Following are the pieces of code that show
how I added a button to the toolbar.
Thanks.
LRESULT CALLBACK CBTProc(int nCode, WPARAM wParam, LPARAM lParam)
{
HWND hWnd;
TCHAR szClass[BUFSIZE];
if(nCode < 0)
return CallNextHookEx(g_hhHook, nCode, wParam, lParam);
hWnd = (HWND)wParam;
switch(nCode)
{
case HCBT_CREATEWND:
GetClassName(hWnd, szClass, sizeof(szClass) - 1);
if(!strcmp(szClass, "ATH_Note"))
{
g_bHookInit = FALSE;
g_pfnOutlookExProc =
(WNDPROC) SetWindowLong(hWnd, GWL_WNDPROC, (LONG)OutlookExpressProc);
}
break;
}
return CallNextHookEx(g_hhHook, nCode, wParam, lParam);
}
LRESULT CALLBACK OutlookExpressProc(HWND hwnd, UINT uiMsg, WPARAM wParam,
LPARAM lParam)
{
static int iTimerID = 0;
if (iTimerID == 0)
iTimerID = SetTimer(hwnd, 1, 100, NULL);
switch (uiMsg)
{
case WM_CREATE:
iTimerID = 0;
break;
case WM_TIMER:
KillTimer(hwnd, iTimerID);
if(!g_bHookInit)
{
HWND hwndSizableRebar;
HWND hwndReBarWindow32;
REBARBANDINFO rbBand;
hwndSizableRebar = FindWindowEx(hwnd, NULL, "SizableRebar", NULL);
hwndReBarWindow32 = FindWindowEx(hwndSizableRebar, NULL, "ReBarWindow32",
NULL);
rbBand.cbSize = sizeof(REBARBANDINFO);
rbBand.fMask = RBBIM_CHILD;
SendMessage(hwndReBarWindow32, RB_GETBANDINFO, 2, (LPARAM)&rbBand);
if(rbBand.hwndChild != NULL)
{
TBBUTTON tbButton;
SendMessage(rbBand.hwndChild, TB_GETBUTTON, 0, (LPARAM)&tbButton);
char szBuf[256];
LoadString(g_hInst, IDS_CUSTOMBTN, (LPSTR) &szBuf, strlen(szBuf) - 1);
int iBtnStringID = SendMessage(rbBand.hwndChild, TB_ADDSTRING, (WPARAM)
0, (LPARAM) (LPSTR) szBuf);
tbButton.idCommand = ID_OE_CUSTOMBTN;
tbButton.dwData = 100;
tbButton.iString = iBtnStringID;
tbButton.fsState = TBSTATE_ENABLED;
tbButton.fsStyle = TBSTYLE_AUTOSIZE | TBSTYLE_BUTTON;
SendMessage(rbBand.hwndChild, TB_INSERTBUTTON, 1, (LPARAM)&tbButton);
g_hwndToolbar = rbBand.hwndChild;
g_bHookInit = TRUE;
}
}
break;
}
switch (LOWORD(wParam))
{
case ID_OE_CUSTOMBTN:
MessageBox(NULL, "CUSTOMBTN", "Outlook Express", IDOK);
break;
case ID_OE_SEND:
MessageBox(NULL, "Send", "Outlook Express", IDOK);
break;
default:
break;
}
return CallWindowProc(g_pfnOutlookExProc, hwnd, uiMsg, wParam, lParam);
}
|
|
|
|
|
Firstly, sorry for the subject
We have written a generic data-access layer which we use to execute stored procedures on a MS SQL Server database and return various data-types depending on the method called (recordset, array, integer etc.). This data-access layer is a COM+ object (because we need to call it from ASP) written with Visual Basic.
We are currently looking at doing a re-write to support some new functionality (XML, multiple output parameters and the like), what I would like to know is would there be a significant performance benefit in porting the code to Visual C++ as an ATL COM+ object?
I have made a number of ATL objects before and I am comfortable writing C++ but if the performance benefit isn't going to be measurable then I might as well leave the code in it's current Visual Basic form... Any input would be greatly appreciated.
William D. Bartholomew
|
|
|
|
|
Last time I checked, IDispatch calling (e.g. VB) was about 10.000 times slower (thats four orders of magnitude) than using the vftable. Depending on your app it will help, but in your case I think the SQL server is the bottleneck.
Of course that's no reason to not make it faster.
/Mike
|
|
|
|
|
Your opinion is appreciated. (Global storage, memory files???)
We want to build objects that are loose coupled and fairly easy to test independently. (Object = DLL, OCX, EXE, whatever). The typical amount of data passed between objects is 2 or 3k, but can be as high as 7 or 8 meg. Lastly, all objects are located on the same machine. Currently all objects are built in VC++ but other languages (VB maybe JAVA) will be used in the future.
In our prototype, object_A uses Cfile and Cachive to create a file on disk, then we use PostMessage to inform Object_B of the files name and location. This has worked great for keeping objects loosely coupled and performing independent testing and development.
Speed is not our overriding consideration, but in our release environment it would be desirable to avoid the writing to disk, furthermore the VB people tell me they cann’t read a Carchive format.
Assuming the VB people are correct then we can change our data format that is not a problem. (But not desirable either given the friendly nature of Carchinve.)
My question to you is about globally allocated memory and memory mapped files. First and foremost, if you are aware of a good book on the subject? Secondly, if you are aware of the pros and cons of either choice?
Thank you
LynnPhil@Qwest.net
|
|
|
|
|
My opinion would be to use the memory mapped file. It would required less change to your existing code, you could possibly just replace CFile with CMemFile.
|
|
|
|
|
Hi,
I haven been using GDI plus to convert a series of tifs to JPEG. Does anyone know how I can access the multiple pages that are suported by the TIF format.
Cheers
Richard
|
|
|
|
|
Sorry Fellas, just realised it's straight forward GetFrameCount and selectActiveFrame in the Image object.
|
|
|
|
|
MSVC has started to report this error when I try to save source files. It occurs maybe one time out of three, even if I have only one instance of VC running. Very annoying.
Has anyone else had this problem with VC6/Win2000? Is it a known bug in VC? I found nothing on MSDN. It might be a Win2000 problem, I've never seen it under Win98.
|
|
|
|
|
I see this a few times every day. Yes, i think it is a Win2k issue. It is really annoying. Even worse than source files, it can sometimes happen in the Class Wizard - and i've actually lost entire source files because of this one. I think CW does its work with temp files. When you make a change, CW creates and modifies a temp file, blows away the original file and tries to copy the temp to the original's name. Sometimes, CW will fail to copy the temp file back, after it has killed the original. The only chance of recovery is to find that temp file. Great fun.
-c
Smaller Animals Software, Inc.
|
|
|
|
|
I had a weird problem recently. I was closing VC when it asked me to save a file [this puzzled me no end as I thought I hadnt made any source changes], I clicked yes and forgot abt it till I reopened the project and found that one of my cpp files was now a zero byte file. I doono how or why it happnd. Luckily I had a 2-day oldbackup, so not much damage done.
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
I've had the one happen too. Never did figure out how it happened.
Michael
|
|
|
|
|
Are you sure that no other VC is running ?
It happens to me sometimes when VC crash, I need to kill it with the Task Manager.
Stephane
"It is ridiculous to claim that video games influence children.
For instance, if PacMan affected kids born in the eighties, we
should by now have a bunch of teenagers who run around in darkened
rooms eating pills while listening to monotonous electronic music."
|
|
|
|
|
Stephane Routelous wrote:
Are you sure that no other VC is running ?
Yes.
It happens to me sometimes when VC crash, I need to kill it with the Task Manager.
I've had that problem too, but I don't think they are related. I get the error even without a crash.
|
|
|
|
|
Yeah, check task manger and see if you see some orphan vc instances running [they are called vcspawn instances]. This happens some times when your program crashes in debug-run mode and takes vc down with it.
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
Sometimes I have open Visual Studio three times at one time,..never had this problem although I have Win2k
modified 12-Sep-18 21:01pm.
|
|
|
|
|