|
Hi
Is there a way of setting the height of vertical scroll bar in a
Combo box?
i.e., even if there's only one item in the Combo, is
it possible to set the height of vertical scroll bar?
What i have seen is, if there's only one item, the vertical scroll bar
is very small or not at all scrolable. I would like to set it a little
longer so that its scrollable.
Thanks
|
|
|
|
|
Is there a way to tie a network connection to a PID (process ID) using Windows Socket functions? I would like to find network connection details associated with a particular process; more specifically in the process, port at which socket is listening and connection state I need to find. Any Windows Socket functions avialable to fetch all these details using VC++?
TIA!
|
|
|
|
|
It's not part of Winsock, but there is a library that can do what you want. Check out the IP Helper Functions (IpHlpApi). There are calls to fetch the active UDP & TCP listens/connections/etc (GetTcpTable & GetUdpTable). These return information that can be passed to GetOwnerModuleFromTcpEntry, GetOwnerModuleFromUdpEntry. Your best bet is to look up these functions on the msdn site.
|
|
|
|
|
Hi,
I'm using CreateTimerQueueTimer to trigger a routine every second. Most of the time it works well, but every once in awhile it won't get triggered for upwards of 20 seconds. What could be causing it and how can I fix it? I run a couple of programs on the same machine using this call and they always stop responding at the same time due to the pause in this function.
Here's the code I'm using
HANDLE m_timerHandle;
DWORD dwTimerPeriod=1000;
HANDLE hTimerQueue = CreateTimerQueue();
BOOL success = ::CreateTimerQueueTimer(&m_timerHandle,hTimerQueue,(WAITORTIMERCALLBACK)TimerRoutine,this,dwTimerPeriod,dwTimerPeriod,WT_EXECUTEDEFAULT);
static SYSTEMTIME now2;
VOID CALLBACK TimerRoutine(PVOID lpParam, BOOLEAN TimerOrWaitFired)
{
int nTime=getSecondsSinceTime(now2);
if(nTime>=2)
wc_logError("timerroutine slow!!! - %d\n",nTime);
bCalcQuoteDelay=true;
bLogStatus=true;
::PostMessage(AfxGetApp()->m_pMainWnd->GetSafeHwnd(), WM_QUEUE_TIMER, NULL,NULL);
GetLocalTime(&now2);
}
Thanks in advance!
Brian
modified on Tuesday, January 26, 2010 2:04 PM
|
|
|
|
|
Given that the documentation specifically states 'These threads are subject to scheduling delays, so the timing can vary depending on what else is happening in the application or the system.', if your need is timing-critical, you may want to find another means of triggering events.
L u n a t i c F r i n g e
|
|
|
|
|
I can create spaces between bitmaps on Toolbar, but how can I create seperators or grouped bitmaps that might look like as if they have seperators between grouped bitmaps?
|
|
|
|
|
It is possible to do it in the resource editor by "dragging" each button image to create the separator, but I find it easier to do it manually in the resource text file :
for example if you have this toolbar:
ITB_STANDARD_TOOLBAR TOOLBAR 18, 16
BEGIN
BUTTON ID_FILE_NEW
BUTTON ID_FILE_OPEN
BUTTON IDM_FILE_SAVE
BUTTON IDM_EDIT_CUT
BUTTON IDM_EDIT_COPY
BUTTON IDM_EDIT_PASTE
END
you can add a SEPARATOR statement where you want to separate between groups:
ITB_STANDARD_TOOLBAR TOOLBAR 18, 16
BEGIN
BUTTON ID_FILE_NEW
BUTTON ID_FILE_OPEN
BUTTON IDM_FILE_SAVE
SEPARATOR
BUTTON IDM_EDIT_CUT
BUTTON IDM_EDIT_COPY
BUTTON IDM_EDIT_PASTE
END
This signature was proudly tested on animals.
|
|
|
|
|
Thats what I have now, thats equivalent to creating space between bitmaps. What I actually want to do is create a vertical line type of seperator somehow to identify sepearte bitmaps as seperate groups.
|
|
|
|
|
isn't this regulated by the "theme" of the application or OS ?
I just create a default application on VS2008 (with feature pack) and the separators are display as "vertical bars"
M.
This signature was proudly tested on animals.
|
|
|
|
|
I see. Thats what I thought too. I must be doing something thats making it not show.
|
|
|
|
|
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
if (!m_wndToolBar.Create(this) ||(
!m_wndToolBar.LoadToolBar(IDR_MAINFRAME) ))
{
TRACE0("Failed to create toolbar\n");
return -1;
}
.......
Above works for one toolbar...
This will load the Main Frame tool bar, How do I load another toolbar next to it, I have (IDR_MAINFRAME2) as another smaller tool bar that i would like to have loaded next to the first one when I launch my app?
Thanks
|
|
|
|
|
Did you Create (in the resources and in the code) the second toolbar ?
After that, placing toolbars side by side, see this :
Docking Toolbars Side-By-Side[^]
This signature was proudly tested on animals.
|
|
|
|
|
|
You might also like to consider the CRebar class[^], which offers more possibilities.
MVP 2010 - are they mad?
|
|
|
|
|
I have dialog based application where I have a testbox / list box and I want to print the values entered in these controls. Pls let me know how to print the data as formated output.
SNI
|
|
|
|
|
The Printing Functions in Win32 are described here[^]. You have to set out your formatting in the same way as you would draw to the screen by using XY coordinates.
MVP 2010 - are they mad?
|
|
|
|
|
thanks for ur reply. I would like to know whether if I have a label / edit box on my dialog box how can I print the value. do I need to take HDC of my dialog and then print.
SNI
|
|
|
|
|
SNI wrote: do I need to take HDC of my dialog and then print.
I think you need to read the documentation in the link I gave you earlier. You will need to create a Printer device context and then display your data on that. It is not quite as simple as saying 'print' and expecting the dialog to magically appear on the printer.
MVP 2010 - are they mad?
|
|
|
|
|
Hi all, i am very very new to c++ hope u guys can pardon me.
I have a file called "newclass.h" which declares a few methods.
#ifndef _NEWCLASS_H
#define _NEWCLASS_H
#include <string>
using namespace std;
class NewClass {
public:
string symbol;
double lastTrade;
double changeValue();
double changePercentage();
void getDow(string symbol, double, double, double) const;
void getNasdaq(string symbol, double, double, double) const;
void getSP_500(string symbol, double, double, double) const;
void getFTSE_100(string symbol, double, double, double) const;
void getDAX(string symbol, double, double, double) const;
void getNikkei_225(string symbol, double, double, double) const;
void getHang_Seng(string symbol, double, double, double) const;
void getStraits_Times_Index(string symbol, double, double, double) const;
};
#endif
and the other file i have is "newclass.cpp"
#include <iostream>
#include "newclass.h"
using namespace std;
how do i continue writing the main function of the method in newclass.cpp
thanks
|
|
|
|
|
You seem to be really confused about a lot of basic concepts in C++. I strongly suggest you start by reading a book (from the begining) about the C++ language first.
|
|
|
|
|
something like :
void NewClass::getDow(string symbol, double value1, double value2, double value3) const
{
}
use the same pattern for the other methods.
Since I do not know what the 3 double variables are, I simply called them value1, value2, value3; I assume that they really mean something; and if they are "returned" values (i.e. variables that you will assign something to them), you better make them either references (prefered) or pointers.
good luck.
This signature was proudly tested on animals.
|
|
|
|
|
|
hi,all.i find a question today,showed below,and i donot know how to resolve it. the code is:
#include <stdio.h>
int main()
{
char ach1[] = {'h'};
char ach2[] = {'h','e'};
return 0;
}
the memory show:(VC++6.0)
ach2 0x0012ff78 68 65 cc cc
ach1 0x0012ff7c 68 cc cc cc
now, how can i do to make the stack memory layout like this:
(ach2)68 65 (ach1)68
need to change some Compiler Settings?
thank u.
|
|
|
|
|
Why do you need that?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
just want to know.
|
|
|
|