|
|
I got the problem, that the combobox can be edited by the user. but i just want him to choose from my values in the list.
the option of "DROPDOWN LIST" isn't of use, cause i have to tell the combobox which value it should have, everytime the dialog comes up.
so my aim: a list field, where i can define the initialsing value.
knows somebody any solution?
|
|
|
|
|
I cannot see why the combo box style CBS_DROPDOWNLIST isn't of any use since it does exactly what I guess you want: disabling the edit box of your combo.
If you want to populate your list, or set it to an initial value, do it in a handler for WM_INITDIALOG. That way your combos list will be initialized before your dialog is shown.
|
|
|
|
|
If i disable the Editbox by using CBS_DROPDOWNLIST, the dropdown field is empty, even if i initialised the variable with 0. so i want the 0 to be (pre)chosen from the list (values from 0 to 3). when i use dropdownlist, the dropdown cant be edited, but is also blank when the dialog comes up...
do you understand what i mean???
|
|
|
|
|
If your using MFC (???)
try the following in your
BOOL CDDDDIalog::OnInitDialog()
{
CDialog::OnInitDialog();
m_wndCombo.AddString("#1");
m_wndCombo.AddString("#2");
m_wndCombo.AddString("#3");
m_wndCombo.SetCurSel(0);
return TRUE;
}
If you're not using MFC, in your handler for WM_INITDIALOG, try something like:
::SendMessage(hWndCombo, CB_ADDSTRING, 0, (LPARAM)"#1");
::SendMessage(hWndCombo, CB_ADDSTRING, 0, (LPARAM)"#2");
::SendMessage(hWndCombo, CB_ADDSTRING, 0, (LPARAM)"#3");
int nIndex = 0;
::SendMessage(hWndCombo, CB_SETCURSEL, nIndex, 0);
|
|
|
|
|
trying to compile a Visaul C++ dll for a VB application.
what setting must I set.
I have created the following heading:
#define CEEPROGS
extern "C" // need for 'C' & VB progs
{
#ifdef CEEPROGS
declspec(dllexport)
#else
int APIENTRY CVDDLL_Main(char *Src,int Srclen,char *DestName,char *ErrorLog);
#define OURCALLING APIENTRY
#endif
}
and from the VB side I declared it as:
Public Declare Function CVDDLL_Main Lib "cvddllmain.dll" (ByVal sFile As String, _
ByVal iLen As Integer, _
ByVal sFileDesc As String, _
ByVal sErrorLog As String) As Integer
now everytime i call CVDDLL_Main I get a bad dll calling convention error?
Confusios say "Man who run in front of car get tired, Man who run behind car get exhausted."
|
|
|
|
|
the function dec i use:
extern "C" int __declspec(dllexport) __stdcall MakeQuery (long nUseAvailable,DWORD searchjob_id,DWORD search_id,DWORD user_id);
the function def line:
int __declspec(dllexport) __stdcall MakeQuery(long nUseAvailable,DWORD searchjob_id,DWORD search_id,DWORD user_id)
the vb module entry:
Public Declare Function MakeQuery Lib "qdbprint.dll" _
Alias "_MakeQuery@16" (ByVal uservailable As Long, ByVal SearchJobID As Long, ByVal search_id As Long, _
ByVal user_id As Long) As Integer
hope this helps
---
"all's fair in love and war but in love there is no geneva convention"
|
|
|
|
|
why ;
Alias "_MakeQuery@16"
do u have to include this?
Confusios say "Man who run in front of car get tired, Man who run behind car get exhausted."
|
|
|
|
|
it lets u use MakeQuery (in the example) instead of _MakeQuery@16 (which i believe is an illegal name in vb)
the @16 bit comes from the number of params u pass ... generally it seems to be 4 bytes per param
if you do it like this it will work
---
"all's fair in love and war but in love there is no geneva convention"
|
|
|
|
|
ok, I change my VB declaration:
Public Declare Function CVDDLL_Main Lib "cvddllmain.dll" Alias "_CVDDLL_Main@16" (ByVal sFile As String, _
ByVal iLen As Integer, _
ByVal sFileDesc As String, _
ByVal sErrorLog As String) As Integer
my c declaration still is:
#define CEEPROGS
extern "C" // need for 'C' & VB progs
{
#ifdef CEEPROGS
__declspec(dllexport) int CVDDLL_Main(char *Src,int Srclen,char *DestName,char *ErrorLog);
#define OURCALLING __declspec(dllexport)
#else
int APIENTRY CVDDLL_Main(char *Src,int Srclen,char *DestName,char *ErrorLog);
#define OURCALLING APIENTRY
#endif
}
but now i get this error:
Can't find DLL entry point _CVDDLL_Main@16 in cvddllmain.dll
Confusios say "Man who run in front of car get tired, Man who run behind car get exhausted."
|
|
|
|
|
ummmm
i dont see your __stdcall bit anywhere?
---
"all's fair in love and war but in love there is no geneva convention"
|
|
|
|
|
OHHHH!!!! THANKS YOU!!!!
/me very happy now.
)
))
thanks again for all you help. works like a bomb now!
Confusios say "Man who run in front of car get tired, Man who run behind car get exhausted."
|
|
|
|
|
Hi,
I have a pointer to an XMlDomDocument, and I would like to have an exactly the same copy of that DomDocument in to another XMLDomDoc ( the content, not the adress), I guess maybe is not so correct to think that with a copy constructor I will have it all solved ( or yes ?).
one *bad* idea about doin that is: get the XML string, and tell the other instance to generate the XML doc from that string... what that would be not very.... optimal...
Can you help me ?, Thanks in advance, Greetings
Braulio
|
|
|
|
|
It has a clone method, or at least the nodes do, so grab the top level node, and clone it when you insert it into a new document.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm somewhat suspicious of STL though. My (test,experimental) program worked first time. Whats that all about??!?!
- Jon Hulatt, 22/3/2002
|
|
|
|
|
Mmm... but I´m afraid that it doesn´t work for the root node..
Thanks !
Braulio
|
|
|
|
|
Now I have a trouble with my project.
In my application, I want to send a byte to hardware port, example a address of printer port but I don't know how to do. Please help me!
Thanks!
TP
|
|
|
|
|
Take a look at the CreateFile() function. You can use this to open any kind of device. In the case of the printer port you would use something like:
HANDLE hLPTA = CreateFile("LPT1", ...) ;
You will then be able to use
ReadFile/WriteFile(handle) to send / get datat from the port.
Unfortunately, I dont have a full example on how to open the printer port, but I can give one for a serial port, with all the configuration calls.
Roger Allen
Sonork 100.10016
If I'm not breathing, I'm either dead or holding my breath.
A fool jabbers, while a wise man listens. But is he so wise to listen to the fool?
|
|
|
|
|
hi,
i posted a message yesterday but have not responses, and reading i thinks it's no well explained my doubt.
i have a managed class CNotificacionNet and unmanaged class CUNotificacionNet.
this is unmanaged code
#include "NotificacionNet.h"
class CUNotificacionNet : CFVNotificacion
{
public:
CUNotificacionNet(void);
~CUNotificacionNet(void);
sofianet::CNotificacionNet * m_pNotifiacion;
bool SetManagedNotifiacion(sofianet::CNotificacionNet*);
};
but when i build my project i recived this error:
c:\sofianet\UNotificacionNet.h(15): error C3265: cannot declare a managed 'm_pNotifiacion' in an unmanaged 'CUNotificacionNet'
any ideas to do it?
Thanks in advance
Salamanca 2002 Capital Cultural Europea, Visitala
|
|
|
|
|
I've been doing a lot of searching for this one, but finally struck gold in MSDN's C++ ME migration guide:
String * sTest = S"This is a test";
char __nogc* pcString = static_cast<char*>(Marshal::StringToHGlobalAnsi(sTest).ToPointer());
Just curious if many people are using this, or if there are other good methods to copy a managed string to an unmanaged char array.
|
|
|
|
|
For building an editor I'd need to know to how to create windows metafiles myself, and how to save them in the end.
Are there some free SDKs or are there already some solutions for pure MFC?
Thanks in advance,
Roland
|
|
|
|
|
Hi,
Just one thing, WMF files are old technology ( Win 3.1 legacy...), if you can choose what to use, rather use EMF files ( Enhanced Metafiles), for more info take a look at the API functions:
CreateEnhMetafile
PlayEnhMetafile
But if you need WMF support, you will find on MSDN lot of info about that as well.
One example about EMF ( load from resources and EMF, and show it in an MFC app, and ATL DLL), you can find it in:
http://www.codeproject.com/atl/PictureTransfer.asp
HTH
Braulio
|
|
|
|
|
Hi, i need to create a virtual serial communication port on windows2000/XP.
This port should be used by normal application program. This port communicate with any windows program that required serial com, and with my program that rules a virtual serial com.Who help me?
Eng. Giuseppe Peschiera
|
|
|
|
|
Hi:
I encount such codes, plz explain them in detail. Thank you in advance.
typedef unsigned (WINAPI *PBEGINTHREADEX_THREADFUNC)(LPVOID lpThreadParameter);
typedef unsigned *PBEGINTHREADEX_THREADID;
Best regard.
I confess that I am a stubborn guy, but why not put things thoroughly, logically and systematically clean. One concrete prolem is worth a thousand unapplied abstractions.
|
|
|
|
|
A typedef allows a new parameter to be created, it's more intelligent than a macro ( I believe ) but does the same sort of thing in effect. In this case, for example, PBEGINTHREADEX_THREADID is the same as an unsigned (int) pointer.
The reason to do this is that the type you use through your code for something specific can be changed just by changing the typedef.
I've never found a use for them, so if anyone else contradicts me, believe them first
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm somewhat suspicious of STL though. My (test,experimental) program worked first time. Whats that all about??!?!
- Jon Hulatt, 22/3/2002
|
|
|
|
|
so my answer could be wrong?
------------------------------------
Rickard Andersson, Suza Computing
ICQ#: 50302279
I'm from the winter country SWEDEN!
------------------------------------
|
|
|
|
|