|
It seems that not, I don´t know why but it seems that Ms Word makes something strange there
Thanks
Braulio
|
|
|
|
|
somewhere on the web, i thought it was here on codeproject but i dont know it really anymore
i found an article frome someone who used a CFile and make it own crypted version of it and make it usable with CArchive. Did someone know this article. I dont find it anymore.
|
|
|
|
|
i am creating activex combobox using visual c++. i am facing one prob... i would like to know how to resize the combobox corresponding to its fontsize. whenever the fontsize or fontchanges the control has to resize not only the edit portion also the dropdown portion.
thanks in advance.
Shanker
|
|
|
|
|
I want to code a spreadsheet program in DOS mode, can anyone suggest some source code? Thanks!
|
|
|
|
|
I created an MDI application. I dynamically create the document, and the child frame in an MDI applicaiton. However, the title bar in the MDI child frame is empty. I tried use pFram->SetWindowText(myTitle), but it doesn't work. How can I set the title for an MDI child frame programatically ?
|
|
|
|
|
Try this:
CDocument::SetTitle(LPCTSTR lpszTitle)
|
|
|
|
|
BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
cs.style &= ~(LONG) FWS_ADDTOTITLE; // add your source code!!!
// and u use SetWindowText!!!
if( !CMDIChildWnd::PreCreateWindow(cs) )
return FALSE;
return TRUE;
}
|
|
|
|
|
I have some code to read the partition table. The structure is supposed to be 512 bytes to read from the disk and I have translated from the Pascal code the following structure to c++:
(The pascal code works fine as it is 512 bytes)
TPartEntry = record
boot_ind : Byte;
head : Byte;
sector : Byte;
cyl : Byte;
sys_ind : Byte;
end_head : Byte;
end_sector : Byte;
end_cyl : Byte;
start_sect : UINT;
nr_sects : UINT;
end;
TDiskTable = record
Data : array[1..446] of Char;
Table : array[1..4] of TPartEntry;
Signature : WORD;
end;
... to get this...
typedef struct tagPARTENTRY
{
BYTE bBoot;
BYTE bHead;
BYTE bSector;
BYTE bCyl;
BYTE bSysInd;
BYTE bEndHead;
BYTE bEndSector;
BYTE bEndCyl;
UINT unStartSect;
UINT unNumSects;
} PARTENTRY;
typedef struct tagDISKTABLE
{
CHAR cData[446];
PARTENTRY tTable[4];
WORD wSignature;
} DISKTABLE;
When I do a sizeof(DISKTABLE) it returns a size of 516 bytes. When I manually add up the values I get 512 bytes. Where are the other 4 bytes coming from and what am I doing wrong?
Cheers,
Clint
|
|
|
|
|
Alignment issues, I guess. Try enclosing the definition of the structure between alignment #pragma s like this:
#pragma pack(push,PREVIOUS_PACK_VALUE,1)
...
#pragma pack(pop,PREVIOUS_PACK_VALUE)
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I have never used the #pragma pack and documentation is a little obscure as to how to use it. I was wondering if you could give me an example based on my sampel code which I provided in my previous post.
Thanks in advance!
Clint
|
|
|
|
|
Thanks for you help. I figured out how to use the #pragma pack and it did the trick. You can just ignore the last reply. Thanks again.
Cheers,
Clint
|
|
|
|
|
hi,
is it neccessary to clear or delete the handle from CreateEvent()?
if i just create a new HANDLE and hold with variable holding previous HANDLE from CreateEvent(), will there anything wrong after long run?
thanks,
jim
|
|
|
|
|
you need to close any handles you dont need
explicitly by using CloseHandle or by using any
function with respect to the particular operation
you are doing which properly releases the resources.
|
|
|
|
|
hi,
do you any method that i can check whether my event object still be in the kernel if i don't execute CloseHandle()?
in my case, i run CreateObject again and again, and put the return handle to cover the previous handle. so, i don't know the previous event object has been destroyed in kernel or not.
do you know any tools to check about this?
|
|
|
|
|
Hello!
I have a simple requirement, I need to make an ActiveX EXE Server using ATL COM and call it from VB. I have to create a simple ATL Object and add a method to it which returns another simple ATL COM Object (which I have also created in the same project) to the caller. Although I can write simple methods using the wizard, I am unable to pass the second object.
I am quite new to VC++ and any help would be greatly appreciated.
Thank you.
|
|
|
|
|
SA wrote:
return a COM Obj from ATL
Ok, first of all you cannot return any objects.
What you can do is return an interface pointer
preferably IDispatch and the vb client will
interact thru it.
|
|
|
|
|
If I understand what you are trying to say, why don't you just create the second object like you did the first, and just retrieve the IUknown pointer... That is to say treat it as you would treat other one as the first one.
|
|
|
|
|
Well, as I had pointed out, I am new to this env. and need a little more elaborate answer.
I created an ATL COM Project.
I added a Simple COM Object.
I added a second simple COM Object.
Now I want to add a method to the first one which takes a few String Parameters and returns (an interface pointer to??) the second object.
Can I get some example for the IDL and the function itself, which creates and returns the second COM Object ?
Thanks in advance.
|
|
|
|
|
What I was recommending is just create the new Object the same way you created the first one but apparantly by reading your new message I understand what you want to do is something a little different.
First of all you can't just return new Object and just cast that to IMyInterface*(If you want the reasons let me know). So what you need to create the first object with Aggretable support. Then create the second simple object using createInstance in the first Object(you will be passing the IUnkonwn* of the first object). Add the COM_INTERFACE_ENTRY_AGGREGATE() macro in the COM map. Dont forget to decrement the reference count when you dont need the second object(remember its still considered a COM object). No need to mess with IDL.
Note: There is a Macro similar to the above that takes care of creation and destruction.
If something is still unclear or need help with a specific part of the code let me know.
|
|
|
|
|
I need to write a DLL and my books don't have a good explanation of how to do so. Any tutorials on the basics?
-Raffi
|
|
|
|
|
There's a secion here on CodeProject that has DLLs, system stuff, etc. There is an article called the ultimate DLL Header file, which explains the ways of how to declare functions to be exported, etc.
Even if you win the rat race, you're still a rat.
|
|
|
|
|
Also, MSDN is a good place to start.
Best regards,
Alexandru Savescu
|
|
|
|
|
I saw where someone was having this same problem and it referenced a post that didn't show up so I am sorry but I must ask it again.
When I load the CTreeCtrl programmatically the checks do not show up. I have done Invalidate and all that and the only way I can get them to show up is if I show the control then empty it and read in the information again (I am buildiing it based on a XML file. I can't see any reason why I am getting this behaviour and have worked on it for a couple of days with nothing but a headache. Thank you very much if you can figure this out. I hope it isn't a stupid rookie mistake.
Bill
|
|
|
|
|
I figured it out. If you create the treectrl with the style tvs_checkboxes you must modify its style to remove that style then add it back. Or just create it without that style then do a modify and add it.
Bill
|
|
|
|
|
Hi !
I'm creating context menu's for a view dynamically (by code and depending on some conditions).
Is there a way to dynamically connect Accelerator Keys to this context menu or do I have to write a mechanism catching the WM_KEYDOWN or a similar message to implement that ?
[I'm using VC++ 6 & MFC, but some WinAPI-Calls to make that possible would also help]
Regards, Marco
|
|
|
|