|
I have no problem with this code... no error, no warning...
What's your error message?
Hello World!!!
from Raphaël
|
|
|
|
|
:(Dear Raphael,
I declared it , inside file header of generic class with other structures.
if i declare the struct inside file .cpp i not have the problem . Why ???
thank's
|
|
|
|
|
Wherever you use your struct, it must be known.
A header file with this definition that is included in any cpp where you use the struct would nornmaly suffice.
But when (in a third header) you make a variable of (instantiate) the struct, the compiler also needs to know it to reserve the right amount of space.
So maybe you need to include the header defining your struct there also.
Hope this helps.
My opinions may have changed, but not the fact that I am right.
|
|
|
|
|
thanks for your help
Davide
|
|
|
|
|
MYSTRUCT mystruct[] =
{
{1,"xxxxxxxxx"},
{2,"YYYYYYYYY"},
{3,"CCCCCCCCC"}
};
Trust in the code Luke. Yea right!
|
|
|
|
|
Inside your structure you have a pointer and you need to allocate memory to use it properly.
for( i = 0; i < 3; i++)
{
mystruct[i].y = new char[ length ];
}
The program might compile and give you no errors but when you don't expect it, it will crash.
// Afterall I realized that even my comment lines have bugs
|
|
|
|
|
Hi
I tried to integrate Contextual MFC Help by using this tutorial here:
http://www.codeguru.com/misc/csh_formview.shtml
but i always seem to get 'no help topic id found for this item'.
But i've added the item to the 'AfxCore.rtf' file.
Can i send someone my VC5 little project to check what's wrong?
I've been searching for the error for some time and i don't seem to find it (
Never mind, i fixed the problem already
Greetings
Jens
|
|
|
|
|
I just know that VC++ .NET has new control/class CHTMLEditCtrl(). Unfortunately, i dont know where is it and how to used it. Will anyone help me how to used it step by step this class? Thanks in advance...
|
|
|
|
|
Anyone, help me plz...
|
|
|
|
|
Hello,
I'm trying to find the 16-bits library "safxcrd.lib" for visual c++ 1.52, but without succes. Can anyone help me with this?
Thanks,
Pieter
|
|
|
|
|
I'm going way out on a limb here, but I think you had to build safxcrd.lib yourself. I also seem to recall that it was a really bad idea since it created problems if far pointers weren't defined correctly (it used the small model for both data and code.... my eyes are getting blurry... small...model... large...model... I... can't... think... aaaahhhhh.....)
|
|
|
|
|
hello,i need help.
i try to use SetWindowHookEx() function to hook keyboard(WH_KEYBOARD) via DLL .it works when my program is activate (show "wParam" in messagebox)but when i click to any running program(my program is deactivate now) it not works.
who can help me ,please
thanks so much
|
|
|
|
|
The last parameter (dwThreadID) in SetWindowHookEx should be zero.
If this parameter is zero, the hook procedure is associated with all existing threads running in the same desktop as the calling thread.
|
|
|
|
|
I don't knosw what it can be, I use this and it works for me... I export one f(x) in the DLL that is called bActivarHook(bool bActivar); what means bActivateHook(bActivate); (it was in catalan ) and inside that f(x) I've placed this code:
DLLSCT_API bool bActivarHook(bool bActivar )
{
if(bActivar == true)
{
hHookTeclat = SetWindowsHookEx(WH_KEYBOARD_LL, HookTeclatLL, hInstDLL, NULL);
return (hHookTeclat != NULL);
}
else
{
if(hHookTeclat != NULL)
{
UnhookWindowsHookEx(hHookTeclat);
return true;
}
else
{
return false;
}
}
} And I call this function from my app (In my case the caller app is a service, but it must do the same...)
well hope this helps...
|
|
|
|
|
I created a program that opens and saves the file using CFileDialog class.
I created a program that opens and saves the file using CFileDialog class.
However, whenever I save some files using this program, files always are hidden and saved as system files.
So, I checked the attributes of CFileDialog of my code.
I only used OFN_OVERWRITEPROMPT in dwflags.
Does CFileDialog class originally save files wih those attributes (hidden and system files)?
Please help me.
I don't want to save files as hidden and system files.
Thanks in advance.
|
|
|
|
|
CFileDialog doesn't save the files at all - it just allows the user to select the file to save.
You normally do something like this:
CFileDialog dlg( FALSE, ... );
if ( dlg.DoModal() == IDOK )
{
// Do the save here
CFile f( dlg.GetFilePath(), CFile::modeCreate|CFile::modeWrite|CFile::shareExclusive );
// Write the file...
f.Close();
}
Post the code that actually is performing the save function (after the CFileDialog's DoModal() method returns), and we'll see if we can spot anything wrong.
Dave
http://www.cloudsofheaven.org
|
|
|
|
|
Thank you for kind explanation.
It was totally my fault.
Actually, I used another header file to write into file using createfile and there were hidden/system attributes in #ifdef~#endif.
Thank you!!!
|
|
|
|
|
I am creating an internal app framework (for company apps).
Using C++ will facilitate my task but I have to make the framework / library usable for C programmers.
Any ideas?
|
|
|
|
|
use extern "C" into fn prototypes (of course they can't be class members)
t!
.h:
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
int my_fn(void);
#ifdef __cplusplus
}
#endif /* __cplusplus */
|
|
|
|
|
Thats it! Thanks. I thought I had to specify function call argument passing (__cdecl, __fastcall, etc) just as Dr John Maddock's Regex++ library.
|
|
|
|
|
It's often a good idea to be specific about the calling convention when exporting from a DLL; if the client program is compiled with a different default convention (using the /Gd, /Gr or /Gz switches) from your DLL it either won't link correctly or will potentially crash at runtime, due to erroneous stack manipulations.
__stdcall is marginally smaller (typically one ADD instruction) at the call site than __cdecl, but __cdecl can handle variable argument lists and is marginally smaller in the function implementation. The ADD instruction is used to reset the stack pointer after the call back to where it was before the compiler started PUSHing arguments. More info in John Robbins' excellent Debugging Applications books (I just bought the most recent one, Debugging Applications for Microsoft .NET and Microsoft Windows - there's a mouthful).
This only applies to desktop Win32 running on IA32 processors; Windows CE on IA32 always uses __cdecl, while other processors only have a single calling convention. Most RISC processors use a calling convention sort of like __cdecl but with the first n arguments passed in registers. This is also true of AMD64 (first 4 arguments passed in RCX, RDX, R8, R9 or XMM0-3 if floating point) and IA64 (first 8 arguments passed in the rotating portion of the register file).
[Yes, I know the processor names look a little unfamiliar; specifying 'x86' isn't very helpful any more because 64-bit 'x86-64' code works differently. AMD now wish Opteron/Athlon64-compatible code to be known as AMD64.]
--
Mike Dimmick
|
|
|
|
|
Thanks for the clarification mike.
|
|
|
|
|
Hi. I am in desperate need of help when it comes to MDI child windows. I need to add controls to them, but I don't know how. I've been using CDialogBar as a replacement, but it is VERY limited compared to an MDI child window. A code snippet would be appreciated, but at least telling me which CWnd is supposed to be the parent of the controls would be helpful.
-- Steve
|
|
|
|
|
SteveBob wrote:
but at least telling me which CWnd is supposed to be the parent of the controls would be helpful.
Typically CChildFrame which is derived from CMDIChildWnd. If you have a Doc.View application then you work with CView derived classes, which are children of CMDIChildWnd.
Hope that helps.
Neville Franks, Author of ED for Windows. www.getsoft.com
Make money with our new Affilate program
|
|
|
|
|
Look up CFormView in MSDN. There are many samples in MSDN and here.
Best wishes,
Hans
|
|
|
|