|
is it possible to hack togheter a dialog in a resource designer and then use it as the main window? CreatwWindowEx() doesn't seem to accept a resource and I've tried using CreateDialog() but can't seem to create the dialog as the main window.
|
|
|
|
|
Yes, dialog-based applications are quite common.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Hi all!
I am using win32(no mfc) and ado.
After I filter my recordset I can no longer use the MOveLast() and MovePrevious() functions... (MoveFirst() and MoveNext() functions are working).
What can be the problem?
Thank you for your future answers!
Well... I am a beginner ...
|
|
|
|
|
Is it that you need to call Refresh or Update?
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
Scolinks wrote:
I can no longer use the MOveLast() and MovePrevious() functions...
Which means?
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Hi - What I need to do is add a way to have a listbox file browser open so that users can select files to add to a list.
If you have VC7 and go to "Find in Files", and then click the "..." to the right of "Look In" - This is basically what I need to create.
Is there an ActiveX control to do this? Do you guys have any suggestions about how I should go about doing this?
Thanks.
|
|
|
|
|
|
I couldn't use SetWindowsHookEx function for cmd.exe or command.com(console windows)? Can any one please tell me How to use SetWindowsHookEx with some example?. SetWindowsHookEx is responding for any windows application but not for cmd.exe.
Viji
|
|
|
|
|
What type of hook (procedure) are you using?
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Hi
I encounter some problems while creating a new VC Custom Appwizard; the desired wizard should give the user a choise of creating dll or exe project. i also needed to add several details to the created dsp, according to the user's choice in one of the appWizard's dialogs, so i needed an access to the .dsp tamplate.
i succeeded in creating dll project because i had the proper .dsp tamplate but couldn't adjust it to be a .dsp of an exe project. where can i find such templates (for MDI, SDI, Dialog based - exe/dll projects) or is there another solution.
Thanks,
Yael
|
|
|
|
|
How can I create a cfg file and read from or write on it?
Thanks for helping!
|
|
|
|
|
|
Further to Michael's answer, it depends on whether you want to use Windows .INI style config files, or XML config files.
For the former, take a look at the functions GetPrivateProfileString and WritePrivateProfileString, but note that using these APIs is not really encouraged, as they're intended for 16-bit compatability.
For the latter, look at using MSXML or use whatever your choice in XML parsers happens to be.
--
Ian Darling
"The moral of the story is that with a contrived example, you can prove anything." - Joel Spolsky
|
|
|
|
|
I'm going to use that in an MFC application to configure oracle connection. I want to use windows .INI style.
|
|
|
|
|
Thanks for your reply
I'm going to use that in an MFC application to configure oracle connection. I want to use windows .INI style.
|
|
|
|
|
Further to Michael's and Ian's replies, see this article if you want to use a custom binary format to read and write configuration data.
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
*.CFG is not a standard used by MFC. MFC usually uses *.INI.
*.CFG is for .NET framework.
Below is the code for C# to access the *.CFG(refering MSDN)
Just change it to Managed C++
using System;
using System.Collections;
using System.Configuration;
class MyConfigurationReader {
public void ReadMySettings() {
IDictionary sampleTable = (IDictionary)
ConfigurationSettings.GetConfig("sampleSection");
string value1 = (string)sampleTable["setting1"];
string value2 = (string)sampleTable["setting2"];
string value3 = (string)sampleTable["setting3"];
}
}
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
Hi!
I am trying to get the dimensions of the screen on my second monitor. I have included windows.h and multimon.h in my program but I always the error message that HMONITOR is an undeclared identifier.
Can anyone give me a hint at what I am doing wrong? Thanks!
Karen
|
|
|
|
|
|
I downloaded a VC++ source project from a original,but I don't build the project successfully,Why?
Let us rap off,for you,for me,for our man!
|
|
|
|
|
LoverOfVCpp wrote:
I downloaded a VC++ source project from a original,but I don't build the project successfully,Why?
I think you need to give us some details (like the error message in the output window, what it is you're trying to build, etc), because that (really vague) problem could have multiple causes:
* Project never built in the first place
* Missing libraries or other dependencies
* Intended for different version of VC++
* Incorrect compiler settings
* Corrupted files interfering with the build
--
Ian Darling
"The moral of the story is that with a contrived example, you can prove anything." - Joel Spolsky
|
|
|
|
|
Is it that the VC++ project is a later project version like VS.NET 2003 and yours are not?
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
Hi all,
when i open the menu in the outlook (not express!) i have New->Appointment
if i select it a dialog is show with 2 tabs:
1. appointment
2. scheduling
i would like to insert my own tab between 1 and 2....how can i do that? can any1 show me code to do that?
also, i want to create a new item between appointment and scheduling....can any1 show me how to do that?
thanks in advanced
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
Hello all, im trying to learn about implementing unicode support in my apps, but i cant seem to get it straight, heres a simple example:
//////////////////// test.cpp //////////////////////
#include <tchar.h>
#include <stdio.h>
#include <windows.h>
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine,int nCmdShow)
{
HANDLE hmutex=CreateMutex(NULL, TRUE, _T("mymutex"));
if(GetLastError()==ERROR_ALREADY_EXISTS)
{
// allready up, so get outa here
return 0;
}
// use some string functions & write some txt to a file
TCHAR str1[50]=_T("string1");
TCHAR str2[20]=_T("string 2");
strcat(str1, str2);
FILE* pfile=fopen(_T("thefile.txt"), _T("w"));
if(pfile)
{
fprintf(pfile, _T("the full string is:%s"), str1);
fclose(pfile);
}
// Remove the mutex, so we can run next time
ReleaseMutex(hmutex);
return 0;
}
ibe added _UNICODE to the preprocesor definitions in project->settings, and when i complile, i get this:
Compiling...
test.cpp
d:\code\test\test.cpp(9) : error C2664: 'CreateMutexA' : cannot convert parameter 3 from 'unsigned short [8]' to 'const char *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
d:\code\test\test.cpp(19) : error C2664: 'strcat' : cannot convert parameter 1 from 'unsigned short [50]' to 'char *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
d:\code\test\test.cpp(21) : error C2664: 'fopen' : cannot convert parameter 1 from 'unsigned short [12]' to 'const char *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
d:\code\test\test.cpp(24) : error C2001: newline in constant
d:\code\test\test.cpp(24) : error C2143: syntax error : missing ')' before 'string'
d:\code\test\test.cpp(24) : error C2664: 'fprintf' : cannot convert parameter 2 from 'unsigned short [22]' to 'const char *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
Error executing cl.exe.
test.exe - 6 error(s), 0 warning(s)
if i also define UNICODE (apart from _UNICODE), the error about CreateMutex() goes away, but not the other ones, its obvious that the char versions of these functions are being called instead of the wide character versions!.
i tought the whole point of using TCHAR and the _T() macros, was that if i decide to build my app with unicode support, i simply define _UNICODE, and if later i decide NOT to use unicode (if for example i target Win9x machines), all i would have to do is NOT define _UNICODE.
what im i doing wrong??
thanks!
|
|
|
|
|
Ernesto D. wrote:
what im i doing wrong??
What you're doing wrong is assuming that the standard C library understands Unicode the same way the Win32 API does. Win32 defines unicode and ascii versions of all APIs (ie, CreateMutex is actually a macro that maps onto CreateMutexA or CreateMutexW as appropriate).
The Standard C library implemented on Windows does have wide-character versions of fopen, fprintf etc (they're _wfopen and fwprintf) - look in MSDN. You may need to define your own macros to handle these seamlessly, but it's probably easier to use the Win32 API or MFC functions instead if you need unicode *and* ascii version of your application. I think there's a way of getting unicode support on 9X, but I can't remember how.
You might also want to read this article[^] on Joel On Software.
--
Ian Darling
"The moral of the story is that with a contrived example, you can prove anything." - Joel Spolsky
|
|
|
|