|
I am trying to create sound effects triggered from switches via parallel port. I want to use MIDI since it doesnt use too much processor resources. But I dunno how to generate sounds (e.g. drum / piano sounds) using MIDI. Does anybody know this?
Programming or Die?
----C++ 4 ever-----
|
|
|
|
|
|
I have problem with that. I use BitBlt at OnDraw(), the print preview was OK, but it prints nothing
<italic>Work hard and a bit of luck is the key to success.
|
|
|
|
|
|
Here is my codes to make a dll:
// =======================================================
// common.h -- header for dll and app.
// =======================================================
#ifndef COMMON_H
#define COMMON_H
#include "iostream"
using namespace std;
#ifdef DLL
#define DLL_EXPORT __declspec(dllexport)
#else
#define DLL_EXPORT __declspec(dllimport)
#endif
// export or import a class definition
class DLL_EXPORT test
{
public:
test() : m(5){}
void print() { cout<< "m = " << m <<endl; }
public:
="" int="" m;
};
="" export="" or="" import="" a="" function="" ..
dll_export="" void="" test_interface(test*="" ptest);
#endif
="" =="===================================================
//" main.cpp="" --="" imp="" for="" dll="" ;="" with="" d="" "dll"="" out:"test.dll"
="" "common.h"
void="" ptest)
{
="" ptest-="">print();
}
And the testing app here:
// =====================================================
// app.cpp -- testing "test.dll"
// =====================================================
#include "windows.h"
#include "common.h"
typedef void (* INIT_PROC)(test* pTest);
int main(void)
{
test t;
HMODULE hModule = ::LoadLibrary("test.dll");
if(hModule)
{
INIT_PROC proc = (INIT_PROC)::GetProcAddress(hModule,
"test_interface");
if(proc)
{
(*proc)(&t);
}
::FreeLibrary(hModule);
}
return 0;
}
There is an error when building app.cpp:
app.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public:
__thiscall test::test(void)" (__imp_??0test@@QAE@XZ)
Debug/test_app.exe : fatal error LNK1120: 1 unresolved externals
I cound't fix it. Plz help. Thanks very much.
|
|
|
|
|
First off, you're using dynamic loading (run-time loading), so the DLLEXPORT and DLLIMPORT statements are unnecessary at the class definition. You should remove these, because you are not exporting/importing this class's objects.
Also, instead of using __declspec , create a module definition file (.DEF) and write the exported function in there. This allows you to control the exact name by which the function is exported. See MSDN for details on how to use a definition file. If you use a definition file, remove the __declspec entries. The definition file is only required at the DLL project. The EXE project does not require it, because the GetProcAddress will search the DLL export table for the specified exported function.
Otherwise the code looks intact and working.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
I would like to create a gateway software solution (with Visual C++ 6.0):
Some machines are connected over ethernet to a server (control PC).
On the control PC (Windows NT) OPC is imitated in one direction (out),
from the other direction I will get some Information from another OPC (in,
OPC machines).
How can I realize that problem??
Exist there any software for gateway solutions ?
Perhaps can i download any software ?
|
|
|
|
|
hi
i want to implement drag and drop. what i want is when some one drops a file on my exe icon it will process that file.
swarup
|
|
|
|
|
You can make an application which is a container. The process of opening the file is done by serialize
<italic>Work hard and a bit of luck is the key to success.
|
|
|
|
|
First off you'll need to call DragAcceptFiles() . Then you'll need to handle the WM_DROPFILES message.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I wrote an application using Visual C++ which uses a database written in Access. I access this database through ADO. It seems this application works fine under XP, 2000 and ME, however I have been told be people using this application under 98SE and NT they are having database issues. So far the database issues are SQL queries that have incorrect syntax, for example "SELECT FROM ORDER Description as" where the correct syntax should be "SELECT * FROM ORDER BY Description asc". I'm not sure why this is happening. Is it possible that NT and 98 might need an additional library so it understands ado? Is ADO compatible in 98 and NT? Do I have to access the database differently for 98 and NT?
Thanks!
|
|
|
|
|
i don`t get it, what happened?
brchris wrote:
for example "SELECT FROM ORDER Description as" where the correct syntax should be "SELECT * FROM ORDER BY Description asc".
Did your app build the wrong query?
<italic>Work hard and a bit of luck is the key to success.
|
|
|
|
|
it must have. I built the error screen that comes up, and I double checked with the guy who received the error screen to make sure that query string was 100% correct as he sees it. So according to him, my app is building wrong query strings on NT. Very bizarre.
|
|
|
|
|
How do you build the string. I had this kind of problem long ago.
<italic>Work hard and a bit of luck is the key to success.
|
|
|
|
|
I build it using the following psuedo code
CString SQL;
SQL.Format("SELECT <fields> FROM where ...");
open table using ADO class.
In a sense I am building them using the CString method and the Format method for pretty much all of my SQL queries.
Thanks!
|
|
|
|
|
Why do you use Format?
My query was:
CString query;
query="SELECT FROM table there var1='";
query+=var; //var is a variable
query+="'";
I think you should debug it. Hope this helps
<italic>Work hard and a bit of luck is the key to success.
|
|
|
|
|
Format seems like an easier way to accomplish the same task you wrote above. It's possible Format could be causing it but why would it remove hard coded values? The string in question is code like this
SQL.Format("SELECT * FROM AG_ERAS ORDER BY Description");
Albiet, it would be interesting to see what this does if I coded it
SQL = "SELECT * FROM AG_ERAS ORDER BY Description;
but that seems odd. Both do exactly the same thing. Unless NT has problems with CString.Format.
I will test the theory though.
Thanks!
|
|
|
|
|
brchris wrote:
SQL = "SELECT * FROM AG_ERAS ORDER BY Description;
Don`t forget with the closing
SQL = "SELECT * FROM AG_ERAS ORDER BY Description";
<italic>Work hard and a bit of luck is the key to success.
|
|
|
|
|
Changing the SQL.Format(...) to SQL = "..."; had no effect.
|
|
|
|
|
Have you try to debug it. What is the query when you debug it. Can I see the code? Maybe I can help
<italic>Work hard and a bit of luck is the key to success.
|
|
|
|
|
how to convert the password in c++ to ****** when u write the password it change to ******
|
|
|
|
|
Assuming you are using standard console functions, write your own version of "gets" that reads in standard character input, but prints only the character '*'.
|
|
|
|
|
Are you typing into an edit control? If so, just use the ES_PASSWORD style.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Whenever I start MSDN Library January 2000 It says: "cant open the file msdn000.col". How can I solve this?I am using WİnXP Pro. Pleasee Help, its urgent!!
B.R.K@4000
|
|
|
|
|
I have the exact same problem with my MSDN library. I cannot fathom what the problem is. The file itself seems to just be an XML file containing links to the .chm files in a tree structure.
To solve my problem I create a seperate .col file and write the contents of the initial file to that. Then I modify the MSDN registry settings and the links in the start-menu etc. to point to the new .col file.
It is a strange thing, and Microsoft don't seem to have offered a fix for it.
See if that works...
|
|
|
|