|
Try typing LAME into Google, & see what you get...
Shog9
---
You'd better turn back, before the frost sets in.
These desert nights are for weathered men,
The ones who've already given in...
|
|
|
|
|
Hi all,
Some days ago I stumpled upon a minor problem in my latest editor.
Imagine you have a modal dialog box and you then click a button which should make the modal dialog go inactive for some time so the user can do some stuff in the main window. So, then when hitting, say, escape in the main window the dialog box from before once again becomes modal.
I found some interesting functions in MSDN:
- EndModalState() / BeginModalState()
- EndModalLoop() / RunModalLoop()
However, I'm experiencing problems with the functions above. First off, the EndModalState() doesn't make the dialog become completely modeless. That is, one cannot use any of the main window's menus or anything in the client area.
Then I tried the EndModalLoop() which actually kind of did what I wanted.. until I found out that that function actually just ends the dialog (that is, return from the DoModal() function) and therefore I cannot continue the old dialog again
So, now my question is to you guys.. do you have any idea on how to achieve this?
Help is greatly appreciated since it prevents me from continuing my work!
OH, and this is MFC, btw!
Thanks in advance,
Soren Dreijer
BlackSmith Studios
|
|
|
|
|
The simplest solution would be to just make the dialog modeless. To simulate the modal behavior, have the dialog enable and disable the parent window as required. If you need the return value from DoModal() , you'll have to establish some other mechanism to return that information (since you won't be calling DoModal() ).
Software Zen: delete this;
|
|
|
|
|
Hey,
Great idea.. already implemented it and it works like a dream.. thanks a bunch! (to make the dialog return a value I could just send a message to the main window or something similar, I guess )
|
|
|
|
|
i was wondering how could i clear a screen in command prompt, i program apps under command prompt and i was wondering to clear anything
|
|
|
|
|
I forgot some ways of actually doing this but I think the best and easiest way would be 'system("cls");', right know I also am doing alot of console programming, I was wondering, are you familiar with the STL library?
|
|
|
|
|
Try searching in the MSDN for the API function AllocConsole . The console functions let you do this sort of thing.
Software Zen: delete this;
|
|
|
|
|
sorry, i have no msdn, does anyone have any other solution, and the system call doesn't seem to work
|
|
|
|
|
|
Hi,
I'm trying to create a dll, but I get an LNK2001 error at a line on my .def file. Why does this happen? I thought .def prevented this. Thanks.
|
|
|
|
|
Anonymous wrote:
...I get an LNK2001 error at a line on my .def file
And that line would be?
Anonymous wrote:
Why does this happen?
Have you looked here?
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
|
Hi,
I'm trying trying to re-compile some source code. The code was written in VC++. However, the writer only included the .h, .c, and a file called makefile. Hence, I'm having trouble re-compiling becuase I don't know the proper settings for the project. I get a lot of LNK2001 errors. I went through the "makefile" and it looks more like the type used on UNIX. Could someone tell me what it is? It's NOT a .mak file. Can I use it to set my project settings?
# Nmake macros for building Windows 32-Bit apps
!include <ntwin32.mak>
# If the rpc include directory is not included in the standard path
# you have to give the path to it here.
RPCINCLUDEPATH = ..
# If the rpc library is not included in the standard lib path
# you have to give the path to it here.
RPCLIBPATH = ..\bin\\
DEFINITION = ONCRPC.DEF
OBJS = CLNT_RAW.OBJ \
XDR.OBJ \
CLNT_TCP.OBJ \
CLNT_UDP.OBJ \
PMAP_RMT.OBJ \
RPC_PROT.OBJ \
SVC_AUTU.OBJ \
SVC_AUTH.OBJ \
SVC_RAW.OBJ \
SVC_RUN.OBJ \
SVC_TCP.OBJ \
SVC_UDP.OBJ \
XDR_MEM.OBJ \
XDR_REC.OBJ \
AUTH_NON.OBJ \
AUTH_UNI.OBJ \
AUTHUNIX.OBJ \
BINDRESV.OBJ \
CLNT_GEN.OBJ \
CLNT_PER.OBJ \
CLNT_SIM.OBJ \
GET_MYAD.OBJ \
GETRPCEN.OBJ \
GETRPCPO.OBJ \
PMAP_CLN.OBJ \
PMAP_GET.OBJ \
PMAP_GMA.OBJ \
PMAP_PRO.OBJ \
PMAP_PR.OBJ \
RPC_CALL.OBJ \
RPC_COMM.OBJ \
SVC_SIMP.OBJ \
XDR_ARRA.OBJ \
XDR_FLOA.OBJ \
XDR_REFE.OBJ \
XDR_STDI.OBJ \
SVC.OBJ \
BCOPY.OBJ \
NT.OBJ
all: oncrpc.dll portmap.exe
clean:
del $(OBJS) oncrpc.lib oncrpc.dll oncrpc.exp portmap.obj portmap.exe ..\rpcgen\oncrpc.dll
portmap.exe: oncrpc.lib portmap.obj
$(link) $(conlflags) $(ldebug) -out:portmap.exe PORTMAP.obj $(RPCLIBPATH)oncrpc.lib $(conlibsdll) wsock32.lib
copy portmap.exe ..\bin\pm_ascii.exe
oncrpc.lib: $(OBJS) oncrpc.def
$(implib) /out:oncrpc.lib /def:$(DEFINITION) $(OBJS)
oncrpc.dll: $(OBJS) oncrpc.lib oncrpc.exp
$(link) /DLL /out:oncrpc.dll -entry:_DllMainCRTStartup$(DLLENTRY) $(ldebug) oncrpc.exp $(OBJS) $(conlibsdll) wsock32.lib advapi32.lib
copy oncrpc.lib ..\bin
copy oncrpc.dll ..\bin
copy oncrpc.dll ..\rpcgen
.c.obj:
$(cc) /I$(RPCINCLUDEPATH) /DONCRPCDLL $(cdebug) $(cflags) $(cvarsdll) $*.c
|
|
|
|
|
Can you not just import makefile into a new VC++ project?
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Is anyone familar with warning C4273? I get this while compiling a static library. When I try to compile an app which uses the lib, I get a link error. I assume the warning and the error are related. Thanks.
|
|
|
|
|
Per MSDN:
The specified member function was declared in a class with dllexport linkage, and then was imported. This warning can also be caused by declaring a member function in a class with dllimport linkage as neither imported nor static nor inline.
The function was compiled as dllexport.
Does any of this apply to your situation?
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
The library was written in native C. I think my problem has to do with the .def file. Not sure.
|
|
|
|
|
How does one include a pre-made ".def" file into a project? I tried to drag and drop into the source files section but this does not seem right. Is it set in the projects setting?
|
|
|
|
|
Anytime I add a file to a project, I use the Project/Add to Project/Files menu option. That said, I'm not sure the linker would automatically know to use a .DEF file.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Simply adding the file does not do it. The Project folders setting needs to be changed. However, I can't seem to edit the inputs.
|
|
|
|
|
I did not find a setting in the Project Settings dialog box, Link tab, for the /DEF linker switch. Perhaps you'll need to modify the .DSP or .MAK file manually to add it.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Within my program, I want to bring a window to another program to the foreground. I'm doing the following:
CWnd *pFV;<br />
<br />
pFV = CWnd::FindWindow(NULL, _T("Another Program Title"));
Then if FindWindow was successful, I call pFV->SetForegroundWindow() to bring it to the front.
This works great in most cases, but it sometimes fails... The program I'm referencing changes its name in the titlebar depending on which options are selected. I don't have the source to the program, so I can't modify it. How can I get a pointer to this window without knowing what the title is going to be? Is there a way to link to the process name?
I also know that the first x characters in the title will always be the same. Is there some way to search through all the titles of open windows to do a comparison?
Any help would be greatly appreciated. Thanks.
Todd Krzeminski
tkrzeminski@nlxcorp.com
|
|
|
|
|
The most efficient method here would be to use Microsoft Spy++ to find out the class name of the window, then use FindWindow on the class name instead of window caption.
Just start Spy++, start the target program, and detect it's class name. If you do not know how to use Spy++, refer to it's help files, they are very throughout.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
I tried that, but for the class name I get an long string (Afx:4000...) that seems to vary each time I run it. Am I doing something wrong?
Thanks,
Todd Krzeminski
tkrzeminski@nlxcorp.com
|
|
|
|
|
This type of class name means that the program uses MFC to register a new class for itself always when it is run.
This means that the class name of the window is not an usable option. The other poster suggested using window enumeration callback routine. I find this the best alternative as well. Just get the caption of each window and compare X characters of it to see if there is a match. I remember you saying that certain characters of the window title always remain constant, so this would sound like the best course of action.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|