|
When you define the field, set a unique index on it. It will not allow duplicates. That is done in the lower left corner of the table definition screen.
|
|
|
|
|
Dear freinds,
hi!!
i have a some problem plz any one can help me........
actually i am working on a apllication which draw a curves on the basis of input data(x & Y coordinates) on graph sheet like a excel.This application is developed in VC++ using MFC.
To make a this application a more generalized i want add functionality that- end user will write a simple console 'c' program to calculate two arrays of x & y coordinates & include some file say plot.h & then pass this array by calling some function say plot(x,y).
then finally result will display on our interface instead of default output window.
so , I want to know that is it possible the output is redirected on our interface.
plz. help me.
thanks!
ashutosh agrawal
mail me at:
ashutosh_agrawal78@rediffmail.com
|
|
|
|
|
Does anyone know if it is possible to create multiple timers using CreateWaitableTimer and then (in another thread) in a loop use to WaitForMultipleObjects to wait on when the timer handles get a signal
I got this too work for a single timer object but when I try it with more than one, WaitForMultipleObjects returns immediately and return 0, which (according to the MSDN docs) is not a return code that is described.
If any one knows of a better way than CreateWaitableTimer that would be cool too (SetTimer is not an option). I guess I could use the multimedia timer but I would like to get things to work with CreateWaitableTimer if possible
Thanks in advance!
|
|
|
|
|
Jim Crafton wrote:
Does anyone know if it is possible to create multiple timers using CreateWaitableTimer and then (in another thread) in a loop use to WaitForMultipleObjects to wait on when the timer handles get a signal
Yes, it is possible and should work without any problem.
I suppose your problem is somwhere else. Maybe you could post some code.
BTW: 0 is the value of WAIT_OBJECT_0 and therefore well defined. It just tells you, that the very first object from your object handle array was signaled.
--
Daniel Lohmann
http://www.losoft.de
(Hey, this page is worth looking! You can find some free and handy NT tools there )
|
|
|
|
|
Here is the scenario. I develop scientific software for a group solidly rooted in Linux. All of the IDE's for Linux pale in comparison to VC++ (which I have used for a while). I have two machines on my desk. One is a MS2K box, the other a Redhat 7.2 box. I would like to devleop and debug on the Win2K using VC++, but the code is running on the Redhat box. Both boxes can communicate to each other (I have used cygwin to transfer files before)via the LAN they are on.
I want to set up a process to automate the communication so that I am debugging the software running on the Linux system. There must be a way to terminal the VC++ into the Linux box to do this since they can see each other, but I know not how.
Does anyone know how I can do this or am I chasing a dream....
Contact me directly at rwhite@lanl.gov
|
|
|
|
|
Hi there,
I have created a multiple thread using a same thread in a class ( based on article from Derek Lakin on threading ). But I cannot share a member variable in that class between the two threads ( memory violation error ). Is there any way to get around this? I have no idea at all.
Thx a lot
|
|
|
|
|
Is the access violation error resulting from two or more threads accessing the same area of the access memory location? You could use thread synchronization such as a CRITICAL_SECTION or a mutex.
Kuphryn
|
|
|
|
|
Use a global variable, not a member of the class.
|
|
|
|
|
I have some code where i try to display a dialog box where a user can choose a specific format. I've filled all the parts of the struct that needs to be filled accoring to the MSDN, but still i get an unhandled exception when running the function. Here's my code:
ACMFORMATCHOOSE acmChoose;
WAVEFORMATEX fmtChoose = { 0 };
acmChoose.pwfx = &fmtChoose;
acmChoose.cbwfx = sizeof(fmtChoose);
acmChoose.cbStruct = sizeof(acmChoose);
acmChoose.hwndOwner = ghWnd;
acmFormatChoose(&acmChoose);
Where ghWnd is a valid handle to my main window.
Anyone know what could be wrong?
Thankyou all, all input is appreciated.
-Rune Svendsen
|
|
|
|
|
I have know idea what is wrong with your code. If you handle the exception, you will find out what the problem is. Add try/catch to your code to catch the exception.
Something like this:
try {
ACMFORMATCHOOSE acmChoose;
WAVEFORMATEX fmtChoose = { 0 };
acmChoose.pwfx = &fmtChoose;
acmChoose.cbwfx = sizeof(fmtChoose);
acmChoose.cbStruct = sizeof(acmChoose);
acmChoose.hwndOwner = ghWnd;acmFormatChoose(&acmChoose);
}
catch (CExcpetion *e) {
handle the excption here ...
This is a general exception. You can catch specific derivitives with things like
catch (CFileException ...
catch (CMemoryException...
These are classes derived from CExcpetion. Your code can have multiple catch clauses for a try clause.
The first catch that qualifies will get the exception.
try {
...
}
catch (CMemoryException *e)
{
...
}
catch (CExceptin *e)
{
...
}
catch (CFileException *e)
{
... This will neverget executed, even if a file exceptionis thrown.The more general CException handler above will get it instead. Be careful of the order. Exceptin handling is a fairly deep topic and a fundamental of windows programming. I'd suggest you research windows exception handling in MSDN or other sources.
|
|
|
|
|
1) What is the debugger telling you in detail about the execption? (Exception type like "Microsoft C++ exception" or "Access violation" or something like that.)
2) If you choose Cancel to debug your app, where exactly the program is halted? This is the point in code which throws the exception.
3) If the above does not give you any helpful information, it might also be a worthwhile option to single-step your code in the debugger to see where exactly the exception occurs.
--
Daniel Lohmann
http://www.losoft.de
(Hey, this page is worth looking! You can find some free and handy NT tools there )
|
|
|
|
|
Hello, Hello,
i have a problem with the doc/view architecture. i am very new to this:
the problem:
i derive a class from "cview" and want to add event when the right mouse button is clicked on the view. on this event, i want to close (destroy) the window.
i tried several comands to close the window. but none of them worked. all i got was memory problems!
who can help me
thanx in advance
kevin
|
|
|
|
|
do this from your view:
GetParentFrame()->PostMessage(WM_CLOSE);
(note that in an SDI app, this will close the whole app)
-c
Conservative:
One who admires radicals centuries after they're dead.
-- Leo C. Rosten
|
|
|
|
|
Is it possible to associate a file type with a document, but to have no visible view, or even no view at all?
I want the file type to be handled by my app, but not to open up a child window. I only want to process it in OnOpenDocument.
thanks,
Jake
|
|
|
|
|
i have an app which uses a split screen.. and when a user has no document selected both of those views are set to a CBlankView which is derived from a CFormView, and the resource i use is just a blank dialog with no frame, menu, etc.
-dz
|
|
|
|
|
My goal is similar to how Visual Studio opens Project and Workspace files: those file types are associated with VS, but they don't open up Views in the middle of the screen, they just fill in some information. I want to imitate this for opening Projects in my application.
thanks,
Jake
|
|
|
|
|
I have two problem here.I read image field from database and want to show it on my formview.I use this code:
COleVariant var;
var.vt = VT_UI1;
var = field.GetChunk(field.GetActualSize());
BITMAPINFO bmInfo;
memset(&bmInfo.bmiHeader,0,sizeof(BITMAPINFOHEADER));
bmInfo.bmiHeader.biSize=sizeof(BITMAPINFOHEADER);
bmInfo.bmiHeader.biWidth=120;
bmInfo.bmiHeader.biHeight=120;
bmInfo.bmiHeader.biPlanes=1;
bmInfo.bmiHeader.biBitCount=24;
HDC pDC = ::GetDC(0);
HDC TmpDC= CreateCompatibleDC(pDC);
HBITMAP TmpBmp=CreateDIBSection(pDC,&bmInfo,DIB_RGB_COLORS,(void**)&var,0,0);
HGDIOBJ TmpObj=SelectObject(TmpDC,TmpBmp);
CRect rect;
GetClientRect(&rect);
int nX = rect.left + (rect.Width() ) / 3;
int nY = rect.top + (rect.Height() + 500 ) / 2 ;
BitBlt( pDC, nX, nY , 200, 200 , TmpDC , 0 , 0 , SRCCOPY );
Only black rectangle appear on my form.I don't know if the problem from reading data from database or my setting for bitmap has some problem.Those who know bitmaps can tell me if it has correct setting.
My second problem is that I can't put bitmap in correct place.It goes out of the application.How can I manage it correctly?
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
Just out of curosity, how do you make a CFindReplaceDialog application modal? I noticed that the one that comes with Excel is app modal, but the one I have is not. So, essentially, if you have two workbooks open in excel and open the find dialog on one of them, it doesn't allow you to switch to the other document until you close the dialog. I gather it must be some flag that is set somewhere..any idea what?
|
|
|
|
|
Hey all,
I am trying to research the feasability of putting together a TFTP file upload for reprogramming an embedded system. I am writing the PC side. I realize that TFTP is a protocol and I am going to read the RFC tonight, however I was wondering if anyone has seen an article or source code that shows examples of something like this.
It needs to be supported over RS232 and IP, which should be possible. The biggest hurdle, I think is that my employer wants instant turn around to get the product out the door. So yes I am looking for examples to reduce turn around, if possible.
Thanks,
Brian aka SanShou
|
|
|
|
|
TFTP servers are pretty easy to write - we've used them for downloading software to embedded systems a few times, usually over a proper TCP/IP stack. To use TFTP over RS232, you're going to have to provide an interface to the RS232 link that effectively emulates what the TCP layer would provide (I think) - no biggy, dial-up modem does that.
As to existing software, try looking on a Linux distro - there may be TFTP software on that, with source?
Stuart Dootson
'Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p'
|
|
|
|
|
I tried to use OnContextMenu and OnRButtonDown to popup the context menu when click right mouse button in a CHtmlView class. When I test it, no menu popup. How to fix it? Thanks.
mIchAel Liu
__________________________________________________________
The secret of business is to know something that nobody else knows.
|
|
|
|
|
OnContextMenu and OnRButtonDown are MFC command handlers. The trouble is that CHtmlView derives from a CView but provides no real support for it. CHtmlView is basically a wrapper around the web browser ActiveX control. You can check out yourself by the way because we have all the code for it.
So all right clicks are in fact consumed by the ActiveX.
The good news is that the web browser control has a mechanism to supersede context menus. You have to implement the IDocHostUIHandler interface. You have built-in samples in MSDN library. (and even in codeproject as far as I remember).
|
|
|
|
|
Thank you. It's a good point.
mIchAel Liu
__________________________________________________________
The secret of business is to know something that nobody else knows.
|
|
|
|
|
Hello there,
I have 10 editbox in my dialog ...
I want to show a message when user pressed enter in the EditBox Number 2(for example) !!!
How can i do that ?
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Keyboard messages...[^]
This should answer your question.
int x=1, y=5;
x^=y^=x^=y;
<a href="http://www.codeproject.com/useritems/StupidXORTrick.asp" target="_blank">ClickHereForHelp();</a>
|
|
|
|