|
Tinman0330 wrote: I'm a VB and Assembly Programmer(Strange mix.. I know..).
"Strange mix" is a definite understatement. I consider that to be the top (just put pieces toghether) and the bottom (actualy know how the pieces work). Assembly is one step below C (system-level) prgramming.
Now the ws2_32.lib (needed if using the ws2_32.dll) is related to Windows Sockets 2. Your code my use WinSockets, but that has nothing to do with your question. The .DEF is a resource file used to specify which functions you wish to export. The "@1" specifies an ordinal number (instead of name), incase you want to access the function via ordinal (never done that myself).
Use VC6 to create a simple .DLL (not an empty one), and read the comments that are generated. The notes will tell you how to export the functions without using a .DEF (which is a hold over for Win3.1 days). Play with it, add some functions, and see if you can access them from VB.
As a VB programmer you should know how to specify the VB equivalent of a function prototype, to access functions in a .DLL. If not there is a tool that comes with VB (there's a better one on the www somewhere) that will insert known Microsoft specific prototypes into your VB code. Look at the C prototypes in the VC6 header files and compare them to the VB equivalent prototypes.
Good Luck!
INTP
Every thing is relative...
|
|
|
|
|
Thank you for the reply! I created a new Dll project and looked at the examples of how to export functions. It looks like I am going to have to change each function in the project, and it is a large project. I was hoping that there would be a simple option for the linker or a short bit of code that could be added to it. Well i'm going to see if I can learn enough C++ to get a better understanding of this problem. If I am wrong about needing to change each function let me know. Thanks for the help!
|
|
|
|
|
I often run into such problem that I create a class successfully but I can't see it in the ClassView pane on the left. sometimes I can't see all of my classes. Reopenning the workspace sometimes can make the previouly hidden class appear and sometimes can not.
how come this happens? and how to prevent it?
Thank you very much!
|
|
|
|
|
I think you should install vc++ .
----------------------------
Jerry yu
Chinese
programming fans
|
|
|
|
|
I think you are using VC6.
Close the project, then try deleting the .NCB file and the .CLW files that are generated by the IDE.
If you delete the clw file, and then open ClassWizard, it will ask you about regenerating this file; say yes to it.
Also when the intellisense dies, it is useful to delete the .NCB file.
this is this.
|
|
|
|
|
|
EDIT: I think I figured out my problem, but if someone could still confirm. Basically I realized the classes that weren't showing up were just plain-old-c++ classes, and they were not derived from CObject (or more importantly CCmdTarget). At least I think that is the reason.
I'm also using VC6 and I have a number of classes that do not show in classwizard. I've tried the above a number of times and they simply do not appear. I've confirmed that the files containing these classes are listed as already in the project, but still nothing. Any idea how I get these added?
-- modified at 22:20 Tuesday 18th October, 2005
|
|
|
|
|
I am having a problem with a rich edit control not redrawing the frame
(border) properly when created over the top of a tab control. If the scroll
bar is shown and I delete all the text the scrollbar is removed and, for
some reason, so is the frame. Also the frame disappears if I minimise the
application and then restore it (no maximise option available). Has anybody
had any experience of this or a similar problem?
AxisFirst For Business
|
|
|
|
|
i have a toolbar made with the Win32 API
<br />
hwndTB = CreateWindowEx( 0, TOOLBARCLASSNAME, NULL, WS_CHILD | TBSTYLE_TOOLTIPS| WS_VISIBLE, <br />
0, 0, 0, 0, hWnd, (HMENU)IDC_TOOLBAR, GetModuleHandle(NULL), NULL );<br />
SendMessage( hwndTB, TB_BUTTONSTRUCTSIZE, (WPARAM)sizeof(TBBUTTON), 0 );<br />
<br />
<br />
HBITMAP hBMP = LoadBitmap( GetModuleHandle(NULL), (LPCTSTR)IDB_TBBUTTONS );<br />
TBADDBITMAP tbab = {NULL,(int)hBMP};<br />
SendMessage( hwndTB, TB_SETBITMAPSIZE, 0, (LPARAM)MAKELONG(16,16) );<br />
SendMessage( hwndTB, TB_ADDBITMAP, 8, (LPARAM)&tbab );<br />
<br />
<br />
TBBUTTON tbb[] = { <br />
{0,IDM_FILE_ADD,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0,0},<br />
{1,IDM_FILE_EDIT,TBSTATE_ENABLED,TBSTYLE_BUTTON,1,1,1},<br />
{2,IDM_FILE_DELETE,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,2,2},<br />
{0,0,TBSTATE_ENABLED,TBSTYLE_SEP,0,0,0},<br />
{3,IDM_STUB_EDIT,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0,3},<br />
{5,IDM_FILE_BUILD,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0,4},<br />
{0,0,TBSTATE_ENABLED,TBSTYLE_SEP,0,0,0},<br />
{4,IDM_HELP_README,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0,5}<br />
}; <br />
SendMessage( hwndTB, TB_ADDBUTTONS, 8, (LPARAM)&tbb );<br />
ShowWindow( hwndTB, SW_SHOW );
the bitmap(IDB_TBBUTTONS) looks like this
http://img422.imageshack.us/my.php?image=toolbarbuttons6gj.png[^]
so far it's working perfect, except i can't figure out how to set the mask, so the pink areas, are transparent..
can anyone help me out here?
|
|
|
|
|
I have not tried your code, but I find that the default generally helps:
The default background color of the toolbar created in VC applications have back color = RGB(192,192,192) Gray.
Try flood-filling the background of the toolbar with this color).
You can also use ImageLists. It seems to give the option of background masks.
this is this.
|
|
|
|
|
Hey,
I have a program that lists processes running on the system. For each Process I can get the Thread IDs of all the threads running in that process... Is it possible for me to use the thread ID for some process X to get that threads Module Name (like a loaded dll it uses) and/or Base address of the execution of that thread ?? Any help here would be appreciated.
Thanks,
Abhishek
|
|
|
|
|
Hi,
You need to use ToolHelp stuff.
See:
MODULENTRY32
Module32First
Module32Next
IMAGE_DOS_HEADER
IMAGE_NT_HEADER
ToolHelp32ReadProcessMemory
--
======
Arman
|
|
|
|
|
Hey Arman,
thanks for your reply... I have been using Thread32 and Process32 functions....how different would those be from Module32 .... What information must I give the module ?
Abhishek
|
|
|
|
|
Hey,
I had a look at the Module Function.....it gives me a list of the Modules that are being used by the process.....More specifically I need to find the start address of where a thread begins execution.
So I have a list of Threads .... how do I know the baseAddress of where they begin execution.
I don't know if you've used process explorer....When you right click on a process in Process Explorer and select properties, it pops up a tabbed window........Clicking on "Threads " in that window we get
a listing of Threads for the process in the form of Module!function....which basically gives the "Thread Start Address" and module name.
Regards ,
Abhishek
|
|
|
|
|
Have you checked the www.sysinternals.com website? I know they have process explorer there, not sure if they have source code for it or not.
.............................
There's nothing like the sound of incoming rifle and mortar rounds to cure the blues. No matter how down you are, you take an active and immediate interest in life.
Fiat justitia, et ruat cælum
|
|
|
|
|
hey,
I don't think sysinternals has the code for ProcessExplorer.......
Thanks
|
|
|
|
|
Hello,
I am having problem in passing pointers.
Here is a function:
static ULONG LoadParameter(lpInterface)
I need to pass this lpInterface pointer to another interface pointer called PDHINTERFACE(It has 4 parameters : ThreadID, input, output, size)
Thanks in advance
|
|
|
|
|
Exactly what is the problem?
Please post specific question.
Top ten member of C++ Expert Exchange.
http://www.experts-exchange.com/Cplusplus
|
|
|
|
|
Okay, so i have this CPropertySheet with multiple CPropertyPages. It gets data from a socket, that is sent up the line on a timing basis. Im having trouble taking this data, and displaying them into a CEdit display. The problem being, when i first execute my application, the current page that it starts out on is fine to update the display fields, but i get into trouble trying to update fields that arent on the active page. I've noticed, if i go real quick and click the tabs, it works fine there-after. So my question is this, Is there a method in either CPropertyPages or CPropertySheet, that will allow me to initialize all the dialog items? Or is there a way to code the clicking of each tab( which i feel is a poor way to handle this problem, but if it works so be it. ) I've thought of just having some global structures that the once i get the data from the socket, save it to the structure, set some update needed flag, and only check the update flags depending on which page im on, but this seems like alot work for a potentially easy solution ( which cant be that easy, cause i've spent some time on this. ) I appriciate any advice you might have, weather opinion or answer, thanks.
-Jader89
"There are 10 types of people, those who understand binary, and those who don't."
- Somebody, not me.
|
|
|
|
|
Another Note, I using the .construct() to create the pages, and adding them using addPage(). Then calling the doModal() method.
"There are 10 types of people, those who understand binary, and those who don't."
- Somebody, not me.
|
|
|
|
|
you can initialize each page when it comes active with CPropertyPage::OnSetActive, if you can initialize the pages when they get created in each page's OnInitDialog.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
When you decalre the pages before adding them to the porpertysheet set the PSP_PREMATURE flag on its flags. This will cause the sheet to create all the pages at the time it opens for the first time.
This should do exactly what you need
If you vote me down, my score will only get lower
|
|
|
|
|
Excatly what i was looking for, thanks a million!
"There are 10 types of people, those who understand binary, and those who don't."
- Somebody, not me.
|
|
|
|
|
|
Hello,
I have a CWnd-derived class that owns several standard MFC controls (CEdit, CTreeCtrl, etc.) When the user hits the ENTER key, I want the main window to handle the message, regardless of what child has the focus.
What's the best way to do this? My current solution is to sub-class each child control and send a message to the parent when the ENTER key is pressed.
I'm hoping there's a better solution.
Any ideas?
Thanks!
-Ian
|
|
|
|
|